Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamlcp does not behave like ocamlc #4354

Closed
vicuna opened this issue Jul 30, 2007 · 3 comments
Closed

ocamlcp does not behave like ocamlc #4354

vicuna opened this issue Jul 30, 2007 · 3 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 30, 2007

Original bug ID: 4354
Reporter: dbrumley
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2007-11-26T16:15:06Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.10.0
Fixed in version: 3.10+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: aij dbrumley jcristau

Bug description

ocamlcp 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 information

I 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.

File attachments

@vicuna
Copy link
Author

vicuna commented Jul 31, 2007

Comment author: aij

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

@vicuna
Copy link
Author

vicuna commented Nov 21, 2007

Comment author: @damiendoligez

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).

@vicuna
Copy link
Author

vicuna commented Nov 26, 2007

Comment author: @damiendoligez

fixed in 3.10.1+dev3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants