Skip to content

Unit JS default param makes compiler crash with "Cannot hash a transient IR node" #15419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
armanbilge opened this issue Jun 11, 2022 · 0 comments

Comments

@armanbilge
Copy link
Contributor

armanbilge commented Jun 11, 2022

Compiler version

3.2.0-RC1-bin-20220609-2836fbc-NIGHTLY

Minimized code

//> using scala "3.2.0-RC1-bin-20220609-2836fbc-NIGHTLY"
//> using platform "js"

package foo

import scala.scalajs.js

@js.native
trait Bar extends js.Object:
  protected[foo] def baz(
    dummy: Unit = js.native,
  ): Unit = js.native

def bar: Bar = ???

@main def main = bar.baz()

Output

Error: Unexpected error when compiling project_2c44eec9c4_2c44eec9c4-45290ff20c: 'Cannot hash a transient IR node (its value is of class class dotty.tools.backend.sjs.JSCodeGen$UndefinedParam$)'

Expectation

The same code compiles in Scala 2. Woops, I guess not. But the Scala 2 error says:

[error] ./bug.scala:15:1: Found a dangling UndefinedParam at Position(file:/workspace/sandbox/bug.scala,18,17). This is likely due to a bad interaction between a macro or a compiler plugin and the Scala.js compiler plugin. If you hit this, please let us know.
@armanbilge armanbilge added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 11, 2022
@sjrd sjrd self-assigned this Jun 11, 2022
@KacperFKorban KacperFKorban added area:scala.js and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 11, 2022
@sjrd sjrd changed the title package-protected method in Scala.js facade doesn't compile Unit JS default param makes compiler crash with "Cannot hash a transient IR node" Jul 20, 2022
@sjrd sjrd closed this as completed in bd13037 Jul 21, 2022
@sjrd sjrd added this to the 3.2.1-RC1 milestone Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants