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

Assert failure from polymorphic variants and existentials #6980

Closed
vicuna opened this issue Sep 6, 2015 · 2 comments
Closed

Assert failure from polymorphic variants and existentials #6980

vicuna opened this issue Sep 6, 2015 · 2 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Sep 6, 2015

Original bug ID: 6980
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:16:28Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 4.02.2
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @diml @hcarty

Bug description

The following produces an assertion failure from ctype.ml:

type 'a t = [< Foo | Bar] as 'a;;

type 'a t = 'a constraint 'a = [< Bar | Foo ]

type 'a s = [< Foo | Bar | Baz > Bar] as 'a;;

type 'a s = 'a constraint 'a = [< Bar | Baz | Foo > Bar ]

type 'a first = First : 'a second -> ('b t as 'a) first

and 'a second = Second : ('b s as 'a) second;;

type 'a first = First : 'b t second -> ([< Bar | Foo ] as 'b) t first
and 'a second = Second : [< Bar | Baz | Foo > Bar ] s second

type aux = Aux : 'a t second * ('a -> int) -> aux;;

type aux = Aux : ([< Bar | Foo ] as 'a) t second * ('a -> int) -> aux

let it : 'a. [< Bar | Foo > Bar ] as 'a = Bar;;

val it : [< Bar | Foo > Bar ] = Bar

let g (Aux(Second, f)) = f it;;

Fatal error: exception File "typing/ctype.ml", line 1170, characters 8-14:
Assertion failed

Process ocaml-toplevel exited abnormally with code 2

@vicuna
Copy link
Author

vicuna commented Nov 27, 2015

Comment author: @alainfrisch

Compiler crash -> bumping priority.

@vicuna
Copy link
Author

vicuna commented Nov 30, 2015

Comment author: @garrigue

Fixed in trunk, commit 9229b15.

@vicuna vicuna closed this as completed Feb 16, 2017
@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added this to the 4.03.0 milestone 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
Projects
None yet
Development

No branches or pull requests

2 participants