Closed
Description
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
package demo
import scala.scalajs.js
def bar: js.Promise[Int] = js.Promise.resolve(()).`then`(_ => 1)
# plugins.sbt
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
# build.sbt
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "3.3.3" // or any of 3.4.0 to 3.4.2
lazy val root = (project in file("."))
.enablePlugins(ScalaJSPlugin)
.settings(
name := "doc_bug_report"
)
Output
[IJ]doc
[info] compiling 1 Scala source to /redacted/doc_bug_report/target/scala-3.3.3/classes ...
[info] done compiling
[info] Main Scala API documentation to /redacted/doc_bug_report/target/scala-3.3.3/api...
-- Error: src/main/scala/demo/demo.scala:5:27 ----------------------------------
5 |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
[info] Main Scala API documentation successful.
[success] Total time: 0 s, completed 27.05.2024, 10:08:40
Expectation
No error occurs (as with scala 3.3.1).