Skip to content

Pattern matching syntax support is incomplete under projected types #23271

Open
@rcano

Description

@rcano

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions