Open MartinHH opened 4 months ago
Reproduction with Scala CLI:
//> using platform js
//> using scala 3.3.2
import scala.scalajs.js
def bar: js.Promise[Int] = js.Promise.resolve(()).`then`(_ => 1)
scala-cli doc repro.scala
# Starting compilation server
# Compiling project (Scala 3.3.2, Scala.js 1.16.0)
# Compiled project (Scala 3.3.2, Scala.js 1.16.0)
# -- Error: repro.scala:4:27 -----------------------------------------------------
# 4 |def bar: js.Promise[Int] = js.Promise.resolve(()).`then`(_ => 1)
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# |undefined: $1$.then # -1: TermRef(TermRef(NoPrefix,val $1$),then) at readTasty
# 1 error found
Last good stable version: 3.3.1 First breaking stable version: 3.3.2
Bisect: Last good release: 3.3.2-RC1-bin-20230615-916d4e7-NIGHTLY First bad release: 3.3.2-RC1-bin-20230619-a68568c-NIGHTLY
Reverting https://github.com/scala/scala3/pull/18989 seems to fix this (on LTS branch at least)
This seems similar to #14143, but the affected scala versions are much newer and the bug does not occur when downgrading to scala 3.3.1:
Compiler version
scala 3.3.3 ; 3.4.0 ; 3.4.1 ; 3.4.2
scala-js 1.16.0 sbt 1.10.0
Minimized code
Output
Expectation
No error occurs (as with scala 3.3.1).