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
Prim evaluation fails on undefined arguments #1297
Comments
I really dislike this warning, it's not very descriptive of what's really happening. If it helps: this warning appears when a case scrutinee is not a constant, but cannot be reduced by the evaluator to a constant (the first snippet of core being what was given, the second being the WHNF of it given by the evaluator). So as far as this error goes, the evaluator is digging down into the term and reducing the GHC.Natural.naturalToInteger undefined == undefined It seems that the rule for That should hopefully be all the info you need to work out a fix 😸 |
The issue is slightly more involved: the evaluator can handle The solution is to consider all primitives that have any undefined arguments as undefined in |
Fix #1297 Co-Authored-By: Christiaan Baaij <christiaan.baaij@gmail.com>
Fix #1297 Co-Authored-By: Christiaan Baaij <christiaan.baaij@gmail.com>
Fix #1297 Co-Authored-By: Christiaan Baaij <christiaan.baaij@gmail.com>
Fix #1297 Co-Authored-By: Christiaan Baaij <christiaan.baaij@gmail.com>
Fix #1297 Co-Authored-By: Christiaan Baaij <christiaan.baaij@gmail.com>
Fix #1297 Co-Authored-By: Christiaan Baaij <christiaan.baaij@gmail.com>
The following fails to compile:
It first emits a warning:
And after a few transformations it crashes:
The expression should be reduced, to undefined. The issue is that the evaluator bails as soon as it sees an undefined value ("Clash.Transformations.undefined") instead of making the result of the primitive undefined too.
The text was updated successfully, but these errors were encountered: