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

Assertion failed in Typecore.expand_path #6394

Closed
vicuna opened this issue May 5, 2014 · 1 comment
Closed

Assertion failed in Typecore.expand_path #6394

vicuna opened this issue May 5, 2014 · 1 comment
Assignees

Comments

@vicuna
Copy link

@vicuna vicuna commented May 5, 2014

Original bug ID: 6394
Reporter: @alainfrisch
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:26:50Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.02.0+dev
Category: typing

Bug description

It is possible to reach the "assert false" in Typecore.expand_path with the following code:

module rec X : sig
type t = int * bool
end = struct
type t = A | B
let f = function A | B -> 0
end

Returning the "p" argument instead of failure seems to fix the problem, but I'd prefer if someone more knowledgeable could confirm this is the right fix.

@vicuna
Copy link
Author

@vicuna vicuna commented May 7, 2014

Comment author: @garrigue

Fixed as suggested in trunk at revision 14757.

I scratched my head a while to understand what is happening:
we are expanding the path of a datatype, so if the environment
is correctly constructed, it can only be a datatype (or an abstract
type is some file is missing).
However, recursive modules may break this invariant by adding
an incoherent equation, which will be detected later.

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