Skip to content
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

Enable stricter pattern matching rules for 3.2 #13832

Closed
SethTisue opened this issue Oct 27, 2021 · 2 comments · Fixed by #14294
Closed

Enable stricter pattern matching rules for 3.2 #13832

SethTisue opened this issue Oct 27, 2021 · 2 comments · Fixed by #14294

Comments

@SethTisue
Copy link
Member

at https://docs.scala-lang.org/scala3/reference/changed-features/pattern-bindings.html it claims:

From Scala 3.1 on, type checking rules will be tightened so that warnings are reported at compile-time instead

In Scala 3.1, a pattern binding is only allowed if the pattern is irrefutable

the changed behavior and additional type checks are only enabled under the -source future setting. They will be enabled by default in version 3.1

but 3.1 is out now and none of these claims came true.

Is the plan still to enable this by default, perhaps for 3.2?

Note that Scala 2.12.15 has now shipped with @smarter's scala/scala#9740 (and 2.13.7 will ship in a matter of days with scala/scala#9721), allowing case in Scala 2, so that will help this Scala 3 change not be a hardship for those who are cross-compiling.

@odersky
Copy link
Contributor

odersky commented Oct 27, 2021

I agree. We should turn these on for 3.2

@smarter
Copy link
Member

smarter commented Oct 27, 2021

Yes, I was waiting for 2.13.7 to be out before turning the warning on by default (also in general we should avoid making claims about specific versions in the doc since we can release minor versions at any time).

@dwijnand dwijnand added this to the 3.2.0 milestone Oct 27, 2021
@anatoliykmetyuk anatoliykmetyuk added the Spree Suitable for a future Spree label Jan 10, 2022
@smarter smarter removed their assignment Jan 10, 2022
@griggt griggt self-assigned this Jan 18, 2022
@griggt griggt removed the Spree Suitable for a future Spree label Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants