Skip to content

Assertion failed in Typecore.expand_path #6394

Closed

Description

@vicuna

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.

Activity

  1. vicuna commented on May 7, 2014

    @vicuna
    Author

    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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions