Skip to content
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

doc fails to read scala.scalajs.js.Promise.then symbol #20476

Closed
MartinHH opened this issue May 27, 2024 · 4 comments · Fixed by #21716
Closed

doc fails to read scala.scalajs.js.Promise.then symbol #20476

MartinHH opened this issue May 27, 2024 · 4 comments · Fixed by #21716
Assignees
Labels
area:doctool area:scala.js itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@MartinHH
Copy link

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).

@MartinHH MartinHH added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 27, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Jun 4, 2024

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

@Gedochao Gedochao added stat:needs bisection Need to use nightly builds and git bisect to find out the commit where this issue was introduced area:doctool area:scala.js regression This worked in a previous version but doesn't anymore and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 4, 2024
@Florian3k
Copy link
Contributor

Bisect:
Last good release: 3.3.2-RC1-bin-20230615-916d4e7-NIGHTLY
First bad release: 3.3.2-RC1-bin-20230619-a68568c-NIGHTLY

Reverting #18989 seems to fix this (on LTS branch at least)

@Florian3k Florian3k removed the stat:needs bisection Need to use nightly builds and git bisect to find out the commit where this issue was introduced label Sep 29, 2024
@WojciechMazur WojciechMazur added this to the 3.6.0 milestone Oct 8, 2024
@keynmol
Copy link
Contributor

keynmol commented Dec 13, 2024

@WojciechMazur is it too late to backport this to LTS?

@WojciechMazur
Copy link
Contributor

@WojciechMazur is it too late to backport this to LTS?

We'll see, we might try backporting that in 3.3.5-RC2.
The mentioned PR that fixed it was problematic - it needed to be reverted once becouse of introduced regression so wee need to be careful here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:doctool area:scala.js itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants