Skip to content

Pattern matching syntax support is incomplete under projected types #23271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rcano opened this issue May 27, 2025 · 0 comments
Open

Pattern matching syntax support is incomplete under projected types #23271

rcano opened this issue May 27, 2025 · 0 comments

Comments

@rcano
Copy link

rcano commented May 27, 2025

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 rcano added the stat:needs triage Every issue needs to have an "area" and "itype" label label May 27, 2025
@Gedochao Gedochao added itype:bug area:pattern-matching and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants