-
Notifications
You must be signed in to change notification settings - Fork 1.1k
irreducible match types should be type errors #10747
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
Related to #7951 |
OlivierBlanvillain
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 9, 2021
OlivierBlanvillain
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 9, 2021
OlivierBlanvillain
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 9, 2021
OlivierBlanvillain
added a commit
to dotty-staging/dotty
that referenced
this issue
Jun 11, 2021
OlivierBlanvillain
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 30, 2021
OlivierBlanvillain
added a commit
to dotty-staging/dotty
that referenced
this issue
Sep 7, 2021
anatoliykmetyuk
added a commit
that referenced
this issue
Sep 14, 2021
Fix #10747: Raise type error on unreducible match type
anatoliykmetyuk
pushed a commit
to dotty-staging/dotty
that referenced
this issue
Sep 14, 2021
Kordyjan
added a commit
that referenced
this issue
Sep 16, 2021
[Backport] Fix #10747: Raise type error on unreducible match type
olsdavis
pushed a commit
to olsdavis/dotty
that referenced
this issue
Apr 4, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimized code
Output
// code compiles fine
Expectation
It seems to me that the concrete instantiation
Foo[Boolean]
should be an immediate type error (as happens when an invalid type argument is provided for a bounded type parameter), ideally with an explanation of the reduction failure.More generally it should be a type error if a term somehow (by inference) ends up with a concretely-instantiated but irreducible match type. The alternative (as now) is that nonsensical types propagate and users have few tools at their disposal to figure out what happened.
I discussed this briefly with @smarter and I understand that it's complicated, but at least in the concrete case I think the compiler could be more helpful.
The text was updated successfully, but these errors were encountered: