Skip to content

Commit

Permalink
Mark genSJSIR as *disabled* (rather than non-*runnable*) when no `-sc…
Browse files Browse the repository at this point in the history
…alajs`.

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]
  • Loading branch information
WojciechMazur committed Jul 10, 2024
1 parent a665d04 commit 96793ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class GenSJSIR extends Phase {

override def description: String = GenSJSIR.description

override def isRunnable(using Context): Boolean =
super.isRunnable && ctx.settings.scalajs.value
override def isEnabled(using Context): Boolean =
ctx.settings.scalajs.value

def run(using Context): Unit =
new JSCodeGen().run()
Expand Down
1 change: 0 additions & 1 deletion sbt-bridge/test/xsbt/CompileProgressSpecification.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class CompileProgressSpecification {
"MegaPhase{pruneErasedDefs,...,arrayConstructors}",
"erasure",
"constructors",
"genSJSIR",
"genBCode"
)
val missingExpectedPhases = someExpectedPhases -- allPhases.toSet
Expand Down
14 changes: 14 additions & 0 deletions tests/pos/i20296.scala
Original file line number Diff line number Diff line change
@@ -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()
}

0 comments on commit 96793ee

Please sign in to comment.