scala3
scala3 copied to clipboard
Pattern matching syntax support is incomplete under projected types
Compiler version
3.7.0
Minimized example
trait A[a] {
trait B[b]
}
??? match {
case _: A[t]#B[String] => ???
}
Output
Not found: type t
Expectation
compiler should treat t as a type variable like it does in other type positions in the pattern match.
Workaround
Creating a type alias
type Fix[a, b] = A[a]#B[b]
??? match { case _: Fix[t, String] => ??? }
works