Skip to content

Support type variable definitions in quoted patterns #16942

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

Conversation

nicolasstucki
Copy link
Contributor

Support explicit type variable definition in quoted patterns. This allows users to set explicit bounds or use the binding twice.

Previously this was only possible on quoted expression patterns case '{ ... }.

case '[type x; `x`] =>
case '[type x; Map[`x`, `x`]] =>
case '[type x <: List[Any]; `x`] =>

In combination with #16907 it would also allow

case '[type f[X]; `f`] =>
case '[type f <: AnyKind; `f`] =>

and therefore solve #10864 and #11738

This is part a part of #16910 that does not need a minor release.

Support explicit type variable definition in quoted patterns.
This allows users to set explicit bounds or use the binding twice.

Previously this was only possible on quoted expression patterns case '{ ... }.

```scala
case '[type x; `x`] =>
case '[type x; Map[`x`, `x`]] =>
case '[type x <: List[Any]; `x`] =>
```

In combination with scala#16907 it would also allow
```scala
case '[type f[X]; `f`] =>
case '[type f <: AnyKind; `f`] =>
```
and therefore solve scala#10864 and scala#11738
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant