We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@static val
3.4.0-RC1-bin-20240112-c50f2ff-NIGHTLY
//> using scala 3.4.0-RC1-bin-20240112-c50f2ff-NIGHTLY //> using platform js import scala.annotation.static class Foo object Foo { @static val bar: String = "bar" @main def main() = println(bar) }
undefined
bar
The text was updated successfully, but these errors were encountered:
@static
@static never made it into the language spec. It's a dotc "compiler feature" for the JVM, not a language feature. Use at your own risk.
That said, PR welcome to make it work on Scala.js anyway. Expect hard problems near initialization semantics, indeed.
Sorry, something went wrong.
It's a dotc "compiler feature" for the JVM, not a language feature.
Could an SJS-specific miniphase (or something) just drop the annotation? Edit: I'm not trying to use it on JS, I just want my code to cross-compile 😅
Maybe, if it doesn't affect observable semantics?
Duplicate of #14710
No branches or pull requests
Compiler version
3.4.0-RC1-bin-20240112-c50f2ff-NIGHTLY
Minimized code
Output
Expectation
The text was updated successfully, but these errors were encountered: