-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Pattern matching exhaustivity warnings on higher kinded types #6088
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
As of #6398, the runtime check warnings are no longer emitted. The only remaining problem is the exhaustivity warning:
|
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Sep 17, 2020
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Sep 18, 2020
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Sep 18, 2020
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Sep 18, 2020
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Sep 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Experimenting with higher-kinded recursion schemes and dotty, I got exhaustivity and unchecked type warnings with the attached code, and I can't make up my mind they are right or spurious
The enum is sealed and all cases are matched so the exhaustivity warning seems spurious.
If the exhaustivity warning is due to the fact that
ExprF[_[_], _]
is a higher-kinded GADT, well it seems that incorrect uses of a natural transformationA ~> B
lifted to[x] => ExprF[A, x] ~> [x] => ExprF[B, x]
usingExprF.hfunctor
will be caught anyway as demonstrated below:So it seems to me that the pattern match is exhaustive and that unchecked warnings are kind of noisy as I see no way of providing wrong input to
nt
that would get uncaught by the type system beforehand.Any how, dotty seems super nice for generic programming !
Attached is a fully working example of higher-kinded catamorphism, only issue are these warnings.
Best regards.
HK.scala.gz
The text was updated successfully, but these errors were encountered: