You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4478 Reporter:@dra27 Assigned to:@garrigue Status: closed (set by @garrigue on 2010-05-21T03:38:15Z) Resolution: fixed Priority: normal Severity: feature Version: 3.09.3 Fixed in version: 3.12.0+dev Category: ~DO NOT USE (was: OCaml general) Related to:#4819
Bug description
Foo.ml:
type t = A | B
Foo.mli
type t = B | A
Running ocamlc -c t.mli t.ml correctly reports that...
The implementation t.ml does not match the interface t.cmi:
Type declarations do not match:
type t = B | A
is not included in
type t = A | B
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?
Additional information
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...
The text was updated successfully, but these errors were encountered:
Original bug ID: 4478
Reporter: @dra27
Assigned to: @garrigue
Status: closed (set by @garrigue on 2010-05-21T03:38:15Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.09.3
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4819
Bug description
Foo.ml:
type t = A | B
Foo.mli
type t = B | A
Running ocamlc -c t.mli t.ml correctly reports that...
The implementation t.ml does not match the interface t.cmi:
Type declarations do not match:
type t = B | A
is not included in
type t = A | B
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?
Additional information
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...
The text was updated successfully, but these errors were encountered: