diff --git a/compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala b/compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala index fbb9042affe7..c44c8f19777b 100644 --- a/compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala +++ b/compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala @@ -11,8 +11,11 @@ class GenSJSIR extends Phase { override def description: String = GenSJSIR.description + override def isEnabled(using Context): Boolean = + ctx.settings.scalajs.value + override def isRunnable(using Context): Boolean = - super.isRunnable && ctx.settings.scalajs.value && !ctx.usedBestEffortTasty + super.isRunnable && !ctx.usedBestEffortTasty def run(using Context): Unit = new JSCodeGen().run() diff --git a/sbt-bridge/test/xsbt/CompileProgressSpecification.scala b/sbt-bridge/test/xsbt/CompileProgressSpecification.scala index bcdac0547e75..dc3956ada0db 100644 --- a/sbt-bridge/test/xsbt/CompileProgressSpecification.scala +++ b/sbt-bridge/test/xsbt/CompileProgressSpecification.scala @@ -66,7 +66,6 @@ class CompileProgressSpecification { "MegaPhase{pruneErasedDefs,...,arrayConstructors}", "erasure", "constructors", - "genSJSIR", "genBCode" ) val missingExpectedPhases = someExpectedPhases -- allPhases.toSet diff --git a/tests/pos/i20296.scala b/tests/pos/i20296.scala new file mode 100644 index 000000000000..910fd07c1298 --- /dev/null +++ b/tests/pos/i20296.scala @@ -0,0 +1,14 @@ +trait Foo + +object Foo { + inline def bar(): Foo = + class InlinedFoo extends Foo {} + new InlinedFoo + + inline def foo(): Foo = + bar() + class InlinedFoo extends Foo {} + new InlinedFoo + + def Test: Foo = Foo.foo() +}