-
Notifications
You must be signed in to change notification settings - Fork 90
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
Type error depends on name of irrelevant record field #1393
Comments
As far as I can tell, all variations of this (also with type annotation on The errors in the dynamically typed variants are pretty useless, though.
|
Same as @vkleen here, I can't reproduce. Both examples are producing static type errors on latest master, although the error message is wrong (@Radvendii I think this is similar to one that you fixed in your PR, what the error thinks is the type of the row is actually the type of the enclosing record type) |
This is clearer in latest master now that #1323 is merged. Now in one case we get a type error and in the other we get a contract violation. In the output @vkleen pasted above, notice that this is not a type error; it's a runtime error.
You can see the error / no error very clearly if you discard the result
|
The thing is, I'm not sure the static typechecker is at fault here. Note that these error messages come from giving |
It seems to be a parsing problem with respect to types annotation. I believe you are just typechecking the record. Putting parentheses do trigger the right error:
It's still a bug though, |
Ok, now this is really strange. If I repeat the same example many times in the REPL, sometimes it works, and sometimes it doesn't... 🤯 |
|
Nope, the binding precedence was a wrong guess of mine, mistaken by the randomness of the bug. After printing the AST with |
Describe the bug
results in a type error
does not
The only difference is whether the second (irrelevant) parameter (
a
/y
) is before or afterx
in the alphabet.Expected behavior
This should result in a type error regardless.
Environment
NixOS
master
The text was updated successfully, but these errors were encountered: