Skip to content
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

Unexported values can cause non-generalisable variables error #7070

Closed
vicuna opened this issue Dec 1, 2015 · 4 comments
Closed

Unexported values can cause non-generalisable variables error #7070

vicuna opened this issue Dec 1, 2015 · 4 comments
Assignees

Comments

@vicuna
Copy link

@vicuna vicuna commented Dec 1, 2015

Original bug ID: 7070
Reporter: @lpw25
Assigned to: @lpw25
Status: resolved (set by @Octachron on 2017-07-27T20:43:42Z)
Resolution: fixed
Priority: low
Severity: feature
Target version: undecided
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: typing
Monitored by: @hcarty

Bug description

The following .ml file:

let r = ref []

let r = 0

gives the error message:

File "foo.ml", line 2, characters 8-14:
Error: The type of this expression, '_a list ref,
contains type variables that cannot be generalized

even though the offending value has been shadowed and so cannot cause any problems.

I think that check_nongen_scheme should probably be run on the simplified signature rather than the original signature.

@vicuna
Copy link
Author

@vicuna vicuna commented Feb 22, 2017

Comment author: @alainfrisch

Are there cases where the error you suggest to avoid is not actually related to a defect in the code (in your case, an unused declaration)?

@vicuna
Copy link
Author

@vicuna vicuna commented Feb 22, 2017

Comment author: @alainfrisch

Not sure this qualifies as a bug, so downgrading to "feature".

@vicuna
Copy link
Author

@vicuna vicuna commented Apr 6, 2017

Comment author: @lpw25

Pull request:

#1139

@vicuna
Copy link
Author

@vicuna vicuna commented Jul 27, 2017

Comment author: @Octachron

Fixed by merging the above PR.

@vicuna vicuna closed this Jul 27, 2017
@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added the feature-wish label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.