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

Expanded error message for universal quantification failure #1993

Merged
merged 2 commits into from Aug 20, 2018

Conversation

Projects
None yet
2 participants
@Octachron
Copy link
Contributor

commented Aug 16, 2018

Currently, type expressions with an incorrect universal quantification, for instance

type a = <m: 'a. int as 'a >

fail with

Error: The universal type variable 'a cannot be generalized:
it is not a variable.

which seems to imply that the universal variable is somehow not a variable.

This PR proposes to remove the ambiguity on the it by expanding this error message to

Error: The universal type variable 'a cannot be generalized:
it is bound to int.

which is quite similar to the related error message

type b = <m: 'a 'b. 'a as 'b >

Error: The universal type variable 'b cannot be generalized:
it is already bound to another variable.

@garrigue
Copy link
Contributor

left a comment

Safe improvement.

@Octachron Octachron force-pushed the Octachron:quantification_clarified branch from 5c972b8 to deec46f Aug 20, 2018

@Octachron

This comment has been minimized.

Copy link
Contributor Author

commented Aug 20, 2018

I updated the changelog and will merge once CI pass.

@Octachron Octachron merged commit b026bda into ocaml:trunk Aug 20, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.