Closed
Description
Catch-all patterns in match type compile with a deprecation warning under -source:future
:
type LeafElem[X] = X match
case String => Char
case Array[t] => LeafElem[t]
case _ => X
// -- Deprecation Warning: tests/pos/6709.scala:5:7 -
// 5 | case _ => X
// | ^
// | `_` is deprecated for wildcard arguments of types: use `?` instead
I think this is an oversight in the syntax and we should change
TypeCaseClause ::= ‘case’ InfixType ‘=>’ Type [nl]
to
TypeCaseClause ::= ‘case’ (InfixType | ‘_’) ‘=>’ Type [nl]