-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Incorrect GADT pattern exhaustivity warning #7524
Comments
This one works for the type pattern object GADT {
import =:=._
enum =:=[A, B] {
case Refl[C]() extends (C =:= C)
}
def unwrap[A,B](opt: Option[A])(using ev: A =:= Option[B]): Option[B] = ev match {
case _: Refl[?] => opt.flatMap(identity[Option[B]])
}
} |
@abgruszecki Did you have an angle of attack for this issue? Maybe @liufengyun could help? |
I think I just assigned this issue to myself because otherwise it'd simply get lost. |
another example in 3.0.1-RC1: object Main extends App:
enum Extends[A, B]:
case Ev[B, A <: B]() extends (A Extends B)
def cast(a: A): B = this match {
case Extends.Ev() => a
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A simplification of #6088
minimized code
error:
The warning goes away if you make
A
contravariant.expectation
No warning
The text was updated successfully, but these errors were encountered: