-
Notifications
You must be signed in to change notification settings - Fork 88
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
Undue ill-formed type
error when using a record field as a type
#701
Comments
After a bit more investigation, the typechecker doesn't like when flat type (contracts) are not variables, which is of course really limiting. Not throwing this error anymore is easy to solve; however the larger issue at hand is that this code appears in |
(Separate issue: #724) |
Describe the bug
When using a record access like
record.Contract
as a type annotation, one get an enigmatic ill-formed type error.To Reproduce
This fires whatever is on the RHS of the contract annotation
null | _
, as long as it is a custom contract., but requires a record access in the outer type annotation. For example,(null | Baz) : foo.Bar
also triggers the error, but neither(null | Bar) : Baz
nor(null | Dyn) : foo.Bar
does.Expected behavior
I expect the example program to be accepted and to return
null
.Additional context
ill-formed type
exception are almost always internal errors: they indicate that a non-row type ended up somewhere in a row position, but I believe those kind of types are impossible to write in the source syntax. There must be a mishandling of custom contracts used as a type somewhere, but it's surprising that anything depends on the structure of the custom contracts, which shouldn't ever be inspected by the typechecker...The text was updated successfully, but these errors were encountered: