Skip to content

Require backticks when defining a type called ?#9735

Merged
dwijnand merged 2 commits intoscala:2.13.xfrom
smarter:qmark-def-error
Aug 26, 2021
Merged

Require backticks when defining a type called ?#9735
dwijnand merged 2 commits intoscala:2.13.xfrom
smarter:qmark-def-error

Conversation

@smarter
Copy link
Member

@smarter smarter commented Aug 24, 2021

Upgrade the deprecation warning from 2.13.6 into an error (but only at
definition site and not use site for now), the ultimate goal would be to
allow and encourage ? as a wildcard in Scala 2 by default so we can
repurpose _ in Scala 3 without causing too much disruption.

@scala-jenkins scala-jenkins added this to the 2.13.7 milestone Aug 24, 2021
Upgrade the deprecation warning from 2.13.6 into an error (but only at
definition site and not use site for now), the ultimate goal would be to
allow and encourage `?` as a wildcard in Scala 2 by default so we can
repurpose `_` in Scala 3 without causing too much disruption.
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just wondering on the messaging.

@dwijnand dwijnand merged commit 8c3abff into scala:2.13.x Aug 26, 2021
SethTisue added a commit to scala/community-build that referenced this pull request Aug 29, 2021
by unfreezing it; the commit we were frozen at was running
afoul of scala/scala#9735
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants