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 failure with type abbreviations #7712

Closed
vicuna opened this Issue Jan 19, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Jan 19, 2018

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
...

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 19, 2018

Comment author: @gasche

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

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 19, 2018

Comment author: @trefis

A tentative fix: #1576

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 23, 2018

Comment author: @trefis

#1576 was merged.

@vicuna vicuna closed this Jan 23, 2018

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.