Skip to content

Commit 8f2d5b9

Browse files
committed
Cleanup level logic
1 parent 7709848 commit 8f2d5b9

File tree

2 files changed

+1922
-3
lines changed

2 files changed

+1922
-3
lines changed

compiler/src/dotty/tools/dotc/inlines/Inliner.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,9 @@ class Inliner(val call: tpd.Tree)(using Context):
10461046
new TreeAccumulator[List[Symbol]] {
10471047
private var level = -1
10481048
override def apply(syms: List[Symbol], tree: tpd.Tree)(using Context): List[Symbol] =
1049-
if (level != -1) foldOver(syms, tree)
1049+
if level != -1 then foldOver(syms, tree)
10501050
else tree match {
1051-
case tree: RefTree if level == -1 && tree.symbol.isDefinedInCurrentRun && !tree.symbol.isLocal =>
1051+
case tree: RefTree if tree.symbol.isDefinedInCurrentRun && !tree.symbol.isLocal =>
10521052
foldOver(tree.symbol :: syms, tree)
10531053
case Quoted(body) =>
10541054
level += 1
@@ -1062,7 +1062,7 @@ class Inliner(val call: tpd.Tree)(using Context):
10621062
level -= 1
10631063
try apply(syms, body)
10641064
finally level += 1
1065-
case TypeApply(fun, _) if level == -1 =>
1065+
case TypeApply(fun, _) =>
10661066
apply(syms, fun)
10671067
case _ =>
10681068
foldOver(syms, tree)

0 commit comments

Comments
 (0)