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
Allow case
in pattern bindings even without -Xsource:3
#9721
Merged
+29
−54
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dwijnand
approved these changes
Aug 9, 2021
needs spec change, IMO |
Fair point, I'll edit the spec. |
smarter
force-pushed
the
case-without-future
branch
from
August 10, 2021 11:15
349d75a
to
0cecad3
Compare
In scala#9558 (which shipped with 2.13.6) we added support for `case` bindings under -Xsource:3. Since this parser change does not break any existing code and since IntelliJ and scalameta/metals now understand this syntax in Scala 2 code, it should be safe to enable it by default to further ease cross-compilation between Scala 2 and 3.
Spec updated. |
SethTisue
approved these changes
Aug 11, 2021
What do you think of backporting this to 2.12 ? |
Sure, I don't see any reason against. |
SethTisue
changed the title
Allow
Allow Oct 29, 2021
case
in pattern bindings even without -Xsource:3case
in pattern bindings even without -Xsource:3
smarter
added a commit
to smarter/scala
that referenced
this pull request
Apr 5, 2022
Like scala#9721, the goal here is to ease cross-compilation between Scala 2 and 3 code as we prepare for `_` as wildcard to be deprecated in Scala 3 (cf scala/scala3#5379). This is technically a source-breaking change, but using a type named ? without backticks is deprecated since 2.13.6 (scala#9626) and defining a type named ? without backticks is disallowed since 2.13.7 (scala#9735). The only known user of ? as a type name was the kind-projector plugin, but support for this syntax was removed from the plugin a year ago (typelevel/kind-projector#186), so I believe this change won't be disruptive.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #9558 (which shipped with 2.13.6) we added support for
case
bindings under -Xsource:3. Since this parser change does not break any existing code and since IntelliJ and scalameta/metals now understand this syntax in Scala 2 code, it should be safe to enable it by default to further ease cross-compilation between Scala 2 and 3.