Skip to content
New issue

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

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

Already on GitHub? # to your account

Scala.js facade fails to compile unless you explicitly call js.native #14289

Closed
AlexITC opened this issue Jan 17, 2022 · 1 comment · Fixed by #16185
Closed

Scala.js facade fails to compile unless you explicitly call js.native #14289

AlexITC opened this issue Jan 17, 2022 · 1 comment · Fixed by #16185
Assignees
Milestone

Comments

@AlexITC
Copy link

AlexITC commented Jan 17, 2022

There is a weird behavior when calling native when importing scala.scalajs.js.native.

See this example to reproduce the problem.

Compiler version

3.1.0 (Scala.js)

Minimized code

import scala.scalajs.js.native

@js.native
trait OnTabReplacedDetails extends js.Object {
  val replacedTabId: Int = native
}

Output

[error] -- Error: /scala-js-chrome/bindings/src/main/scala/chrome/webNavigation/bindings/OnTabReplacedDetails.scala:11:27 
[error] 11 |  val replacedTabId: Int = native
[error]    |                           ^^^^^^
[error]    |            Concrete members of JS native types may only call js.native.
[error] one error found

Expectation

The code should behave just like calling js.native.

@sjrd sjrd self-assigned this Jan 18, 2022
@sjrd
Copy link
Member

sjrd commented Jan 18, 2022

Thanks for the report. I'll have a look when I get the chance.

sjrd added a commit to dotty-staging/dotty that referenced this issue Oct 14, 2022
sjrd added a commit to dotty-staging/dotty that referenced this issue Oct 14, 2022
sjrd added a commit to dotty-staging/dotty that referenced this issue Oct 19, 2022
little-inferno pushed a commit to little-inferno/dotty that referenced this issue Jan 25, 2023
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants