File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/dotty/tools/dotc/transform
tests/pending/pos/tailcall Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class LambdaLift extends MiniPhaseTransform with IdentityDenotTransformer { this
31
31
import ast .tpd ._
32
32
33
33
/** the following two members override abstract members in Transform */
34
- val phaseName : String = " lambdalift "
34
+ val phaseName : String = " lambdaLift "
35
35
36
36
override def runsAfter : Set [Class [_ <: Phase ]] = Set (classOf [Constructors ])
37
37
// Constructors has to happen before LambdaLift because the lambda lift logic
@@ -164,9 +164,13 @@ class LambdaLift extends MiniPhaseTransform with IdentityDenotTransformer { this
164
164
val sym = tree.symbol
165
165
tree match {
166
166
case tree : Ident =>
167
- if (sym.maybeOwner.isTerm)
168
- if (sym is (Method , butNot = Label )) markCalled(sym, enclosure)
167
+ if (sym.maybeOwner.isTerm) {
168
+ if (sym is Label )
169
+ assert(enclosure == sym.enclosure,
170
+ i " attempt to refer to label $sym from nested $enclosure" )
171
+ else if (sym is Method ) markCalled(sym, enclosure)
169
172
else if (sym.isTerm) markFree(sym, enclosure)
173
+ }
170
174
case tree : Select =>
171
175
if (sym.isConstructor && sym.owner.owner.isTerm)
172
176
markCalled(sym, enclosure)
File renamed without changes.
You can’t perform that action at this time.
0 commit comments