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
approx_type ignores structural types #6478
Comments
Comment author: @garrigue Indeed, there is something wrong here. |
Comment author: @damiendoligez I may be totally wrong, but I seem to remember that approx_type was extended to get better type errors for let rec. [edit: IIRC it was extended by Alain] |
Comment author: @alainfrisch After a quick look at the history, it seems that the only changes I did on Typecore.approx_type were related to changes in the definition of the Parsetree (no changes on the behavior). |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Probably worth having another look at it. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Original bug ID: 6478
Reporter: @lpw25
Assigned to: @garrigue
Status: confirmed (set by @garrigue on 2014-07-06T00:59:24Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.02.0+dev
Category: typing
Monitored by: @gasche
Bug description
approx_type
(which approximates the type of a constraint in a recursive definition) does not handle structural types. This can lead to some surprising behaviour, since using an alias of a structural type does work.For example:
Ideally, the constraints in recursive definitions would be properly typed during approximation, although I assume there is some reason this is not already the case.
Even if there is a good reason this cannot be done, it is potentially confusing, so I thought it was worth creating an issue for.
The text was updated successfully, but these errors were encountered: