You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Activity
vicuna commentedon 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.