scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Pattern matching syntax support is incomplete under projected types

Open rcano opened this issue 6 months ago • 0 comments

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

rcano avatar May 27 '25 14:05 rcano