File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 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:
162162 * source and target of the jump
163163 */
164164 protected def stackChange (using Context ) =
165- if enclosingBoundaries == 0 then ctx else shadowLabels
165+ ctx // if enclosingBoundaries == 0 then ctx else shadowLabels
166166
167167 /** Need to suppress labeled returns if there is an intervening try
168168 */
@@ -178,6 +178,10 @@ class DropBreaks extends MiniPhase, RecordStackChange:
178178 case Break (_, _) => ctx
179179 case _ => stackChange
180180
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+
181185 // other stack changing operations are handled in RecordStackChange
182186
183187 /** If `tree` is a BreakBoundary, transform it as follows:
You can’t perform that action at this time.
0 commit comments