Reproduction steps
Scala version: 2.13.16
type ArrayLike[+X] >: Array[_ <: X] <: AnyRef
(new Array[String](0) :ArrayLike[_] @unchecked) match {
case _ :Array[AnyRef] => println("yes")
case _ => println("no")
}
Problem
unbound wildcard type
(new Array[String](0) :ArrayLike[_] @unchecked) match {
Compiles correctly without @unchecked.
Why would I want it? In more complex cases, generic type T[X] cannot be matched against T[Something] because of an error 'match pattern does not conform to matches subject' (or similar). Hence uptyping to an existential type. Presence of annotation @unchecked in this case was mandated by #13167
Reproduction steps
Scala version: 2.13.16
Problem
Compiles correctly without
@unchecked.Why would I want it? In more complex cases, generic type
T[X]cannot be matched againstT[Something]because of an error 'match pattern does not conform to matches subject' (or similar). Hence uptyping to an existential type. Presence of annotation@uncheckedin this case was mandated by #13167