Closed
Description
Compiler version
3.2.1-RC1-bin-20220904-b5fea82-NIGHTLY
Minimized code
While investigating , I noticed *:
-tuples in unapply return raise refutable pattern warnings.
class Foo
object Foo:
// def unapply(f: Foo): (Int, Int) = ??? // does not raise a warning
def unapply(f: Foo): Int *: Int *: EmptyTuple = ???
@main def example =
val Foo(x, y) = new Foo
println(x)
Output
val Foo(x, y) = new Foo
^^^^^^^^^^^^^^^^^^^
pattern binding uses refutable extractor `tuple_refutable_pattern_issue.this.Foo`
If this usage is intentional, this can be communicated by adding `: @unchecked` after the expression,
which may result in a MatchError at runtime.
This patch can be rewritten automatically under -rewrite -source 3.2-migration.
Expectation
No warning, as this can not result in a MatchError at runtime.