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
Type error message when constructors are mis-ordered could be clearer #4478
Original bug ID: 4478
type t = A | B
type t = B | A
Running ocamlc -c t.mli t.ml correctly reports that...
However, the mismatch is only because the constructors are misordered. This is a slightly cryptic error unless you know about the internals of OCaml - perhaps in this instance, ocamlc could note that the types would be compatible if the constructors were in the same order?
I was being daft here and wrote an mli file with my brain switched off. Although I know from writing C stubs that the constructors must obviously be in the same order for the types to be the same, it took quite me some time to realise my stupidity because the type I was dealing with was much longer. The additional warning would be most useful!
I presume 3.10.1 behaves the same way...