Skip to content

Commit 96793ee

Browse files
committed
Mark genSJSIR as *disabled* (rather than non-*runnable*) when no -scalajs.
This works around the issue seen in #20296. However, the issue resurfaces if we actually run `-Ycheck:all` in a Scala.js-enabled build. [Cherry-picked a88312b][modified]
1 parent a665d04 commit 96793ee

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Diff for: compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class GenSJSIR extends Phase {
1111

1212
override def description: String = GenSJSIR.description
1313

14-
override def isRunnable(using Context): Boolean =
15-
super.isRunnable && ctx.settings.scalajs.value
14+
override def isEnabled(using Context): Boolean =
15+
ctx.settings.scalajs.value
1616

1717
def run(using Context): Unit =
1818
new JSCodeGen().run()

Diff for: sbt-bridge/test/xsbt/CompileProgressSpecification.scala

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ class CompileProgressSpecification {
6666
"MegaPhase{pruneErasedDefs,...,arrayConstructors}",
6767
"erasure",
6868
"constructors",
69-
"genSJSIR",
7069
"genBCode"
7170
)
7271
val missingExpectedPhases = someExpectedPhases -- allPhases.toSet

Diff for: tests/pos/i20296.scala

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
trait Foo
2+
3+
object Foo {
4+
inline def bar(): Foo =
5+
class InlinedFoo extends Foo {}
6+
new InlinedFoo
7+
8+
inline def foo(): Foo =
9+
bar()
10+
class InlinedFoo extends Foo {}
11+
new InlinedFoo
12+
13+
def Test: Foo = Foo.foo()
14+
}

0 commit comments

Comments
 (0)