-
Notifications
You must be signed in to change notification settings - Fork 114
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
Inferred type of modulus is a bit odd? #663
Comments
The type checker is inferring |
This might be an unintentional side effect of trying to avoid spurious warnings on RISC-V, where |
The fix is probably to use the constants to check completeness, but then discard any redundant arm warnings if we did so. |
I guess #534 might provide enough information that you don't need to discard redundant arm warnings? |
Should be fixed by #665 We aren't actually being that clever about detecting redundant arms if they aren't obviously being caused by a combination of wildcard patterns, so spurious warnings shouldn't be an issue. If we were detecting redundant arms in a constraint-aware way (which we could do, but it might be slow as it would require using the SMT solver to check a constraint for each arm separately) then #534 would indeed help avoid any issues. |
Sorry I may have oversimplified the example! The one I posted now works, but in my actual code the expression is not constant:
That still triggers the warning. |
Looks like there's a difference when checking completeness for something like |
This code works fine:
Except it prints this warning:
That's clearly not the case, and in fact if you just add an explicit type annotation the warning disappears:
but I feel like that shouldn't be necessary and it's kind of weird that it makes a difference while being happy to pass
test
tofoo()
in both cases.The text was updated successfully, but these errors were encountered: