-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Match type on parameterized trait doesn't preserve input parameter in type variable #14151
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
Comments
Note that this is also true with just sealed trait Single[B]
type Retrieve[A, T <: Single[_ <: A]] <: A = T match {
case Single[b] => b
} but I was not sure whether that is the same issue or not. |
Probably related to #11205 |
looks like it to me and Dale, this (the |
This can be minimized further: trait Single[B]
type Retrieve[A, T <: Single[A]] <: A = T match
case Single[b] => b
-- [E007] Type Mismatch Error: -------------------------------------------------
3 | case Single[b] => b
| ^
| Found: b
| Required: A and further: trait Single[B]
type Retrieve[A] <: A = Single[A] match
case Single[b] => b same error. |
Compiler version
3.1.0, 3.1.1-RC1, 3.1.1-RC2
Minimized code
Output
Expectation
Second[Animal, BoundedPair[Animal, Cat]]
⇒Cat
The text was updated successfully, but these errors were encountered: