Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004478OCamlOCaml generalpublic2008-01-13 17:432010-05-21 05:38
Reporterdra 
Assigned Togarrigue 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.09.3 
Target VersionFixed in Version3.12.0+dev 
Summary0004478: Type error message when constructors are mis-ordered could be clearer
DescriptionFoo.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 InformationI 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...
TagsNo tags attached.
Attached Files

- Relationships
related to 0004819closedgarrigue Type error on record declarations too hard to read 

-  Notes
(0005480)
garrigue (manager)
2010-05-21 05:38

Error messages concerning type declaration mismatches have been greatly improved for 3.12.

- Issue History
Date Modified Username Field Change
2008-01-13 17:43 dra New Issue
2008-01-18 15:37 doligez Status new => acknowledged
2010-04-30 07:25 garrigue Status acknowledged => assigned
2010-04-30 07:25 garrigue Assigned To => garrigue
2010-05-21 05:38 garrigue Note Added: 0005480
2010-05-21 05:38 garrigue Status assigned => closed
2010-05-21 05:38 garrigue Resolution open => fixed
2010-05-21 05:38 garrigue Fixed in Version => 3.12.0+dev
2010-05-21 05:51 garrigue Relationship added related to 0004819


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker