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

More robust handling of type variables in mcomp #1517

Merged
merged 3 commits into from Dec 7, 2017

Conversation

trefis
Copy link
Contributor

@trefis trefis commented Dec 6, 2017

When comparing two types, Ctype.mcomp asserts that if neither of them is a variable, then they can't both be expanded to a variable.
The first commit adds an example of a code to the testsuite showing that this assertion doesn't hold.

The second commit removes the assertion and handles variables in the exact same way as before expansion of the types.
MPR#6158 and the related commit seem to confirm that this is the correct fix.

The handling of variables pre-expansion is redundant, but I left it in place to serve as a short-circuit since expansion might be costly.
I however doubt that it will be triggered often in practice, as "external" calls to mcomp are always preceeded by calls to reify.

Copy link
Contributor

@garrigue garrigue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted.
The fix is trivial, so please go forward and merge it.

Fatal error: exception File "typing/ctype.ml", line 2028, characters 30-36: Assertion failed'
@trefis trefis merged commit 148e6a2 into ocaml:trunk Dec 7, 2017
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants