File tree 1 file changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/transform
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ class DropBreaks extends MiniPhase, RecordStackChange:
162
162
* source and target of the jump
163
163
*/
164
164
protected def stackChange (using Context ) =
165
- if enclosingBoundaries == 0 then ctx else shadowLabels
165
+ ctx // if enclosingBoundaries == 0 then ctx else shadowLabels
166
166
167
167
/** Need to suppress labeled returns if there is an intervening try
168
168
*/
@@ -178,6 +178,10 @@ class DropBreaks extends MiniPhase, RecordStackChange:
178
178
case Break (_, _) => ctx
179
179
case _ => stackChange
180
180
181
+ override def prepareForValDef (tree : ValDef )(using Context ): Context =
182
+ if tree.symbol.is(Lazy ) && tree.symbol.owner == ctx.owner.enclosingMethod then shadowLabels
183
+ else ctx
184
+
181
185
// other stack changing operations are handled in RecordStackChange
182
186
183
187
/** If `tree` is a BreakBoundary, transform it as follows:
You can’t perform that action at this time.
0 commit comments