Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
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
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...