Skip to content

assertion failure with type abbreviations #7712

Closed

Description

@vicuna

Original bug ID: 7712
Reporter: mkoconnor
Assigned to: @garrigue
Status: resolved (set by @trefis on 2018-01-23T10:25:57Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: typing
Monitored by: @nojb @gasche

Bug description

The following code raises an assertion failure in the compiler for me:

type 'a or_error = string

type ('a, 'b) t_ =
| Bar : ('a, 'a or_error) t_

type 'a t = ('a, 'a) t_

let f : type a. a t -> a t = function
| Bar -> Bar

The first few lines of the stack trace are:

Fatal error: exception File "typing/btype.ml", line 585, characters 6-12: Assertion failed
Raised at file "typing/btype.ml", line 585, characters 6-18
Called from file "typing/btype.ml", line 595, characters 13-40
Called from file "typing/ctype.ml", line 2541, characters 12-34
Called from file "typing/ctype.ml", line 2395, characters 8-32
Re-raised at file "typing/ctype.ml", line 2459, characters 20-188
Called from file "typing/ctype.ml", line 2355, characters 8-24
Re-raised at file "typing/ctype.ml", line 2396, characters 29-51
Called from file "list.ml", line 122, characters 24-31
...

Activity

  1. vicuna commented on Jan 19, 2018

    @vicuna
    Author

    Comment author: @gasche

    I can reproduce with all OCaml versions supporting GADTs, including a reasonably recent trunk.

  2. vicuna commented on Jan 19, 2018

    @vicuna
    Author

    Comment author: @trefis

    A tentative fix: #1576

  3. vicuna commented on Jan 23, 2018

    @vicuna
    Author

    Comment author: @trefis

    #1576 was merged.

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