Skip to content

Differentiate Scala 2 and Scala 3 wildcard identifier names#9614

Merged
lrytz merged 1 commit intoscala:2.13.xfrom
7mind:differentiate-scala2-3-wildcard-names
May 10, 2021
Merged

Differentiate Scala 2 and Scala 3 wildcard identifier names#9614
lrytz merged 1 commit intoscala:2.13.xfrom
7mind:differentiate-scala2-3-wildcard-names

Conversation

@neko-kai
Copy link
Contributor

@neko-kai neko-kai commented May 6, 2021

This change names wildcards written with Scala 3 ? syntax with ?$N pattern instead of _$N used for Scala 2 wildcards

There are two reasons for it:

  • To allow kind-projector to implement Scala 3 underscore syntax for type lambdas by transforming old-style underscores, but leaving Scala 3 underscores intact
  • To show a mildly more relevant error message, since a wildcard introduced by ? will now also have a name with ? in the error message

See also:

This change names wildcards written with Scala 3 `?` syntax with `?$N` pattern instead of `_$N` used for Scala 2 wildcards

There are two reasons for it:

- To allow `kind-projector` to implement Scala 3 underscore syntax for type lambdas by transforming old-style underscores, but leaving Scala 3 underscores intact
- To show a mildly more relevant error message, since a wildcard introduced by `?` will now also have a name with `?` in the error message
@neko-kai
Copy link
Contributor Author

neko-kai commented May 7, 2021

This change is required together with #9605 to implement typelevel/kind-projector#188

@lrytz lrytz merged commit 5a04e29 into scala:2.13.x May 10, 2021
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label May 10, 2021
@lrytz lrytz removed the release-notes worth highlighting in next release notes label May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants