Skip to content

Commit 0f753ab

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.
1 parent 41f1489 commit 0f753ab

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ class GenSJSIR extends Phase {
1111

1212
override def description: String = GenSJSIR.description
1313

14+
override def isEnabled(using Context): Boolean =
15+
ctx.settings.scalajs.value
16+
1417
override def isRunnable(using Context): Boolean =
15-
super.isRunnable && ctx.settings.scalajs.value && !ctx.usedBestEffortTasty
18+
super.isRunnable && !ctx.usedBestEffortTasty
1619

1720
def run(using Context): Unit =
1821
new JSCodeGen().run()

tests/pos/i20296.scala

Lines changed: 14 additions & 0 deletions
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)