Skip to content

Commit ea26264

Browse files
Make elimErasedCtx a lazy val
Let it crash if combined with `-Ystop-after:erasure`
1 parent 7ee203b commit ea26264

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/src/dotty/tools/dotc/transform/Bridges.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class Bridges(root: ClassSymbol, thisPhase: DenotTransformer)(implicit ctx: Cont
1616

1717
assert(ctx.phase == ctx.erasurePhase.next)
1818
private val preErasureCtx = ctx.withPhase(ctx.erasurePhase)
19-
private def elimErasedCtx =
20-
if ctx.elimErasedValueTypePhase.exists then ctx.withPhase(ctx.elimErasedValueTypePhase.next)
21-
else ctx // can happen with -Ystop-after:erasure
19+
private lazy val elimErasedCtx = ctx.withPhase(ctx.elimErasedValueTypePhase.next)
2220

2321
private class BridgesCursor(implicit ctx: Context) extends OverridingPairs.Cursor(root) {
2422

0 commit comments

Comments
 (0)