Skip to content

To aid cross building, allow ? as a wildcard even without -Xsource:3#9990

Merged
dwijnand merged 1 commit intoscala:2.13.xfrom
smarter:default-qmark-wildcard
Apr 14, 2022
Merged

To aid cross building, allow ? as a wildcard even without -Xsource:3#9990
dwijnand merged 1 commit intoscala:2.13.xfrom
smarter:default-qmark-wildcard

Conversation

@smarter
Copy link
Copy Markdown
Member

@smarter smarter commented Apr 5, 2022

Like #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 (#9626) and defining a type named ? without backticks is disallowed since 2.13.7 (#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.

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.
@smarter
Copy link
Copy Markdown
Member Author

smarter commented Apr 5, 2022

Ideally I'd like to have this in 2.12 too, but unfortunately #9626 / #9735 were never backported to 2.12. IMO we could go straight for backporting this change and skip the deprecation step.

@lrytz
Copy link
Copy Markdown
Member

lrytz commented Apr 6, 2022

SGTM. @dwijnand, @SethTisue?

@smarter
Copy link
Copy Markdown
Member Author

smarter commented Apr 13, 2022

IMO we could go straight for backporting this change and skip the deprecation step.

Any opinion on this before I open a PR?

@dwijnand
Copy link
Copy Markdown
Member

I'm happy with that plan.

@dwijnand dwijnand merged commit 18ce8d4 into scala:2.13.x Apr 14, 2022
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Apr 14, 2022
smarter added a commit to smarter/scala that referenced this pull request Apr 18, 2022
This backports scala#9990 to Scala 2.12 as discussed in that PR.
@smarter
Copy link
Copy Markdown
Member Author

smarter commented Apr 20, 2022

@SethTisue
Copy link
Copy Markdown
Member

opened typelevel/kind-projector#210 to notify the kind-projector folks

@blast-hardcheese
Copy link
Copy Markdown

I've opened a PR to temporarily revert scalameta/scalameta#2733 until 2.12.16 and 2.13.9 are released, as source code generation is now broken for all releases in the 2.12 and 2.13 lines. Once the releases are cut, there's a follow-up PR to reintroduce the new ?-defaults.

Broadcasting intent here, in case others run into the same issue I did, no longer being able to generate code that compiles with the currently released latest versions of either 2.12 or 2.13.

@SethTisue SethTisue changed the title Allow ? as a wildcard even without -Xsource:3 To aid cross building, allow ? as a wildcard even without -Xsource:3 Sep 1, 2022
@SethTisue SethTisue changed the title To aid cross building, allow ? as a wildcard even without -Xsource:3 To aid cross building, allow ? as a wildcard even without -Xsource:3 Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes worth highlighting in next release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants