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 fires when compiling with -rectypes #6814

Closed
vicuna opened this issue Mar 15, 2015 · 2 comments
Closed

Assertion fires when compiling with -rectypes #6814

vicuna opened this issue Mar 15, 2015 · 2 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Mar 15, 2015

Original bug ID: 6814
Reporter: ggole
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:49:12Z)
Resolution: not a bug
Priority: normal
Severity: major
Version: 4.02.1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: typing
Monitored by: @hcarty

Bug description

Compiling the following program with -rectypes results in an assertion failure:

Fatal error: exception File "typing/typecore.ml", line 1899, characters 65-71: Assertion failed

As the comment suggests, replacing the underscore (or compiling without -rectypes) avoids the crash.

type (_, _) t =
| Nil : ('t, 't) t
| Cons : ('t -> 'a) * ('r, 't) t -> (('a -> 'r), 't) t

(* replacing the _ here with b results in no crash *)
let test : type a b . a -> (_, a) t -> unit =
fun value -> function
| Nil -> ()
| Cons (getter, rest) -> ignore (getter value)

I also reproduced on 4.03.0.

@vicuna
Copy link
Author

vicuna commented Mar 20, 2015

Comment author: @damiendoligez

Downgrading to "major" because it's not a program crash, only a compiler crash.

@vicuna
Copy link
Author

vicuna commented May 6, 2015

Comment author: @garrigue

No longer reproduced at revision 16088 (both 4.02 and trunk).

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added this to the 4.02.2 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