-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Combination of if, recursion, val binding and match crashes Typer with failed assertion #6815
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
@smarter part of the problem seems to be that the type inferred for
Is this intended? (The TypeBox part, that is). If we annotate (To get the original code to compile, a sanity check @ https://github.com/lampepfl/dotty/blob/master/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala#L194 needs to be commented out) |
The typebox thing happens because we're doing wildcard capture of the type of |
I just said that in case you wanted to experiment - the check is to ensure that no "fictional" type variables invented by GadtConstraint escape. I'll see why exactly |
Closes scala#6815
Closes scala#6815
Closes scala#6815
minimized code
It is worth noting that this code would not compile even if it didn't cause the crash; in the code this is minimised from, I had forgotten to cast from a
Computes[_]
to aComputes[T]
. Fixing that error prevents the crash.Looking at the stacktrace, it seems I hit some edge case the GADT solver doesn't handle?
Stack trace
The text was updated successfully, but these errors were encountered: