-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #14488: Scala.js: Add compiler support for scala.Enumeration. #15770
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
Conversation
|
Play JSON actually actively tests for the presence of the bug: |
|
@sjrd perhaps you could set `play-json`.js / Test / unmanagedSources / excludeFilter := HiddenFileFilter || "EnumSpec.scala"`a little trick I've employed about a million times in the Scala 2 community build |
e954ac3 to
b419bca
Compare
|
Change the test, I'd say, as it's tracking progression rather than spec or regression. |
Thanks, I'm trying that now.
I guess that's also a possibility. But that means it's a commit in our fork that is neither a cherry-pick from upstream, nor something I can PR back upstream anytime soon. Is that OK? |
|
Yep, or at least to me it is. |
This is the same logic that is used in the Scala.js compiler plugin
for Scala 2.
We catch ValDefs of the forms
val SomeField = Value
val SomeOtherField = Value(5)
and rewrite them as
val SomeField = Value("SomeField")
val SomeOtherField = Value(5, "SomeOtherField")
For calls to `Value` and `new Val` without name that we cannot
rewrite, we emit warnings.
| @@ -1,4 +1,4 @@ | |||
| // scalajs: --skip --pending | |||
| // scalajs: --skip | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test uses extends Val without explicit name, which is not supported (and was never supported in Scala 2 either).
Alright, that worked as well. @dwijnand Would you mind reviewing this PR, perhaps? It's mostly a port of the |
|
Ping @dwijnand ? |
This comment was marked as resolved.
This comment was marked as resolved.
|
Thanks 🙏 |
This is the same logic that is used in the Scala.js compiler plugin for Scala 2.
We catch ValDefs of the forms
and rewrite them as
For calls to
Valueandnew Valwithout name that we cannot rewrite, we emit warnings.