GADT exhaustiveness check is broken #5892
Original bug ID: 5892
I haven't explored the issue fully, but there is something wrong with the GADT exhaustivness check. The problem is probably in Ctype.mcomp.
The following files will give a segmentation fault when run:
module type Num = sig
module Make (N: Num) = struct
module Bad = struct
module Types = Make(Bad)
let bad: (int, Types.nil Types.cons) Types.t = Types.Nil
module Types : sig
val bad: (int, Types.nil Types.cons) Types.t
let hd: type a b . (a, b TestList.Types.cons) TestList.Types.t -> a =
let _ = hd TestList.bad
Steps to reproduce
$ ocamlc -c testList.mli
The text was updated successfully, but these errors were encountered:
Comment author: @garrigue
Fixed in 4.00 and trunk, revisions 13250 and 13252.
Ctype.in_pervasives was broken: looking for a path TestList.nil in the empty environment also looks it up inside testList.cmi...