Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007712OCamltypingpublic2018-01-19 17:272018-01-23 11:25
Reportermkoconnor 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.07.0+dev 
Summary0007712: assertion failure with type abbreviations
DescriptionThe 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
...

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018836)
gasche (developer)
2018-01-19 17:59

I can reproduce with all OCaml versions supporting GADTs, including a reasonably recent trunk.
(0018837)
trefis (manager)
2018-01-19 18:14

A tentative fix: https://github.com/ocaml/ocaml/pull/1576 [^]
(0018854)
trefis (manager)
2018-01-23 11:25

GPR#1576 was merged.

- Issue History
Date Modified Username Field Change
2018-01-19 17:27 mkoconnor New Issue
2018-01-19 17:59 gasche Note Added: 0018836
2018-01-19 17:59 gasche Assigned To => garrigue
2018-01-19 17:59 gasche Status new => confirmed
2018-01-19 18:14 trefis Note Added: 0018837
2018-01-23 11:25 trefis Note Added: 0018854
2018-01-23 11:25 trefis Status confirmed => resolved
2018-01-23 11:25 trefis Fixed in Version => 4.07.0+dev
2018-01-23 11:25 trefis Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker