Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004354OCamlOCaml generalpublic2007-07-31 00:292007-11-26 17:15
Reporterdbrumley 
Assigned Todoligez 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.10.0 
Target VersionFixed in Version3.10+dev 
Summary0004354: ocamlcp does not behave like ocamlc
Descriptionocamlcp does not seem to resolve type variables the same as ocamlc.
e.g., in the attached code we get the error with ocamlcp -p a:

Values do not match:
  val dprintf : ('_a, unit, string, unit) format4 -> '_a
is not included in
  val dprintf : ('a, unit, string, unit) format4 -> 'a

but it compiles fine with ocamlc.
Additional InformationI ran the following:
$ ocamlc -p a -c debug.mli
$ ocamlc -p a -c debug.ml
File "/tmp/camlppfe086a", line 208, characters 0-1736:
Signature mismatch:
Modules do not match:
  sig
    val debug : bool
    val pdebug : string -> unit
    val pdebug : string -> unit
    val dprintf : ('a, unit, string, unit) format4 -> 'a
    val dprintf : ('_a, unit, string, unit) format4 -> '_a
    val dtrace :
      before:('a -> unit) -> f:('a -> 'b) -> after:('b -> unit) -> 'a -> 'b
    val dtrace :
      before:('_a -> unit) ->
      f:('_a -> '_b) -> after:('_b -> unit) -> '_a -> '_b
    val warn : bool
    val pwarn : string -> unit
    val pwarn : string -> unit
    val wprintf : ('a, unit, string, unit) format4 -> 'a
    val wprintf : ('_a, unit, string, unit) format4 -> '_a
  end
is not included in
  DEBUG
Values do not match:
  val dprintf : ('_a, unit, string, unit) format4 -> '_a
is not included in
  val dprintf : ('a, unit, string, unit) format4 -> 'a

However, ocamlc compiles fine:
$ ocamlc -c debug.mli
$ ocamlc -c debug.ml
$

I tried this with both ocaml 3.10.0 compiled from source, and ocaml-3.09.2 from the dpkg in the ubuntu distribution.
TagsNo tags attached.
Attached Files? file icon debug.mli [^] (2,013 bytes) 2007-07-31 00:29 [Show Content]
? file icon debug.ml [^] (6,944 bytes) 2007-07-31 00:29 [Show Content]

- Relationships

-  Notes
(0004126)
aij (reporter)
2007-07-31 19:58

I reported this bug in the debian BTS a while ago, but I guess they never sent it upstream.

Anyways, there's a minimal example and a bit more information at:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=418634 [^]
(0004337)
doligez (administrator)
2007-11-21 17:44

It's not obvious whether we can fix this. In the meantime,
the workaround is to eta-expand your dprintf function (which
you presumably don't want to do, for efficiency reasons), or
to avoid compiling debug.ml in profile mode (which does not
prevent you from profiling the rest of your program).
(0004354)
doligez (administrator)
2007-11-26 17:15

fixed in 3.10.1+dev3

- Issue History
Date Modified Username Field Change
2007-07-31 00:29 dbrumley New Issue
2007-07-31 00:29 dbrumley File Added: debug.mli
2007-07-31 00:29 dbrumley File Added: debug.ml
2007-07-31 19:58 aij Note Added: 0004126
2007-11-10 14:59 xleroy Status new => assigned
2007-11-10 14:59 xleroy Assigned To => doligez
2007-11-21 17:44 doligez Note Added: 0004337
2007-11-21 18:51 doligez Summary ocamlcp does behave like ocamlc => ocamlcp does not behave like ocamlc
2007-11-26 17:15 doligez Note Added: 0004354
2007-11-26 17:15 doligez Status assigned => closed
2007-11-26 17:15 doligez Resolution open => fixed
2007-11-26 17:15 doligez Fixed in Version => 3.10+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker