Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003545OCaml~DO NOT USE (was: OCaml general)public2005-03-17 04:042013-08-01 10:48
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003545: Shadowing not handled correctly in .ml-generated .cmi
DescriptionFull_Name: Aleksey Nogin
Version: 3.08.2
OS: Mandrake Linux 10.0
Submission from: (

If I have a .cmi that is generated by compiling a ".mli-free" .ml, and the .ml
has shadowing, then an attempt to re-compile .ml while type-checking against the
.cmi will fail with a type error!

% ocamlc -version

% ls x.*

% cat
let x = 1

let x = "s"

% ocamlc -c

% ls x.*
x.cmi x.cmo

% ocamlopt -c -intf-suffix .cmi
The implementation does not match the interface x.cmi:
Values do not match: val x : string is not included in val x : int

P.S. You might wonder why one would want to do something like this in the first
place. Basically, I want to have build rules that would allow:
a) building both native and bytecode versions of an OCaml project
b) parallelized builds.

I want to be able to say that in the absence of .mli, the way to generate .cmi
file is to run ocamlc on .ml. The problem with is is that once the .cmi is
generated by the ocamlc, some "consumer" of that .cmi may end up running in
parallel with the ocamlopt for the .ml. Since ocamlopt would create the .cmi
again and will actually overwrite it in place, I am likely to get a "corrupted
.cmi" error message from the "consumer" process.

I was hoping to be able to solve this by using "ocamlopt -intf-suffix .cmi" for
compiling .ml files whenever building both native and bytecode versions. This
did not work because of this bug.

This "build rules" issue is discussed in slightly more detail in a bug report
for the OMake build system is [^]

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2005-08-08 11:52

Obvious fix (attempted 2005-08-02 by XL) doesn't work. This bug is not
critical, so I'll leave it as feature wish.
xleroy (administrator)
2013-08-01 10:48

The issue appears fixed in 4.01. At some point in the past, inferred signatures were cleaned up w.r.t. multiple definitions. Closing this PR.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2013-08-01 10:48 xleroy Note Added: 0010054
2013-08-01 10:48 xleroy Status acknowledged => closed
2013-08-01 10:48 xleroy Resolution open => fixed
2013-08-01 10:48 xleroy Description Updated View Revisions
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker