-
Notifications
You must be signed in to change notification settings - Fork 659
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
Infinite type error on type that does not appear to be infinite #1614
Comments
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
Hi, I think the error message is legitimate in the sense that it should fail to compile. The problem is that type alias Focus big small =
{ get : big -> Maybe small
, update : (small -> small) -> big -> big
} So in particular So I think the issue here is the first of your options, "why does it read so badly". |
Just to add that I think the following is a more minimal example: type alias Bad small big =
{ f : big -> small
, g : big -> small
}
toMaybe : a -> Maybe a
toMaybe a = Just a
identity : a -> a
identity a = a
bad = Bad toMaybe identity Which gives the error:
|
In fact you don't actually need the second type variable: type alias Bad a =
{ f : a -> a
, g : a -> a
}
toMaybe : a -> Maybe a
toMaybe a = Just a
identity : a -> a
identity a = a
bad = Bad toMaybe identity Which gives:
|
Summary and update of @mkolosick's report in #956.
The following code:
Results in the following error with the pre-0.19 compiler:
What is going on here? Is this error message legitimate? If so, why does it read so badly? If not, what is going on to cause this?
The text was updated successfully, but these errors were encountered: