diff --git a/compiler/src/dotty/tools/dotc/transform/Bridges.scala b/compiler/src/dotty/tools/dotc/transform/Bridges.scala index 44b071e8792e..dd95d301f73d 100644 --- a/compiler/src/dotty/tools/dotc/transform/Bridges.scala +++ b/compiler/src/dotty/tools/dotc/transform/Bridges.scala @@ -16,7 +16,7 @@ class Bridges(root: ClassSymbol, thisPhase: DenotTransformer)(implicit ctx: Cont assert(ctx.phase == ctx.erasurePhase.next) private val preErasureCtx = ctx.withPhase(ctx.erasurePhase) - private val elimErasedCtx = ctx.withPhase(ctx.elimErasedValueTypePhase.next) + private lazy val elimErasedCtx = ctx.withPhase(ctx.elimErasedValueTypePhase.next) private class BridgesCursor(implicit ctx: Context) extends OverridingPairs.Cursor(root) { diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index 27764ea1aa4f..435351fa1794 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -65,6 +65,7 @@ class CompilationTests extends ParallelTesting { compileFile("tests/run/i5606.scala", defaultOptions.and("-Yretain-trees")), compileFile("tests/pos-custom-args/i5498-postfixOps.scala", defaultOptions withoutLanguageFeature "postfixOps"), compileFile("tests/pos-custom-args/i8875.scala", defaultOptions.and("-Xprint:getters")), + compileFile("tests/pos-custom-args/i9267.scala", defaultOptions.and("-Ystop-after:erasure")), ).checkCompile() } diff --git a/tests/pos-custom-args/i9267.scala b/tests/pos-custom-args/i9267.scala new file mode 100644 index 000000000000..83d15dc739b5 --- /dev/null +++ b/tests/pos-custom-args/i9267.scala @@ -0,0 +1 @@ +class A