Skip to content

Enable stricter pattern matching rules for 3.2 #13832

Closed
@SethTisue

Description

@SethTisue

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions