Skip to content

Commit 36ccb24

Browse files
committed
Tweak
1 parent 0dd88e5 commit 36ccb24

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/shared/main/scala/mlscript/compiler/codegen/CppAst.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ enum Specifier:
1414
case Static
1515
case Inline
1616

17-
def toDocument = raw(
17+
def toDocument = raw:
1818
this match
1919
case Extern => "extern"
2020
case Static => "static"
2121
case Inline => "inline"
22-
)
2322

2423
override def toString: Str = toDocument.print
2524

compiler/shared/main/scala/mlscript/compiler/optimizer/TailRecOpt.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ class TailRecOpt(fnUid: FreshInt, classUid: FreshInt, tag: FreshInt, raise: Diag
344344
else searchOptCalls(body)
345345
case LetMethodCall(names, cls, method, args, body) =>
346346
// method call is unresolved, just ignore it
347-
searchOptCalls(body)(acc, src, scc, start, calledDefn, letCallNode, letCtorNode, containingCtors -- names.toSet)
347+
// `containingCtors -- names.toSet` takes care of variable shadowing
348+
searchOptCalls(body)(acc, src, scc, start, calledDefn, letCallNode, letCtorNode, containingCtors -- names.toSet)
348349
case x @ LetCall(names, defn, args, isTailRec, body) =>
349350
val callInScc = scc.contains(defn.expectDefn)
350351

0 commit comments

Comments
 (0)