caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Change in typing between OCaml 4.01.0 and 4.02.2...
@ 2015-06-26 18:07 Stéphane Glondu
  2015-06-26 19:15 ` Jeremy Yallop
  0 siblings, 1 reply; 4+ messages in thread
From: Stéphane Glondu @ 2015-06-26 18:07 UTC (permalink / raw)
  To: caml users; +Cc: Debian Ocaml Maint ML, 790062

Hello,

I am debugging why monotone-viz doesn't compile with OCaml 4.02.2. I
have reduced the problem to the following:

$ cat query.mli
val make : #App.t -> unit
$ cat app.mli
class type status =
  object
    method pop : unit -> unit
  end

class type t =
  object
    method query : status -> unit
  end

val make : unit -> t
$ cat app.ml
class type status =
  object
    method pop : unit -> unit
  end

class type t =
  object
    method query : status -> unit
  end

class ctrl : t =
  object (self)
    method query status =
      Query.make self;
      status#pop ()
  end

let make () =
  new ctrl
$ ocamlc -c app.mli
$ ocamlc -c query.mli
$ ocamlc -c app.ml

With OCaml 4.02.2, I get the following error message:

  File "app.ml", line 15, characters 6-12:
  Error: This expression has type App.status
         It has no method pop

which looks wrong. With OCaml 4.01.0, there is no error.

Does anyone understand what is going on?


Cheers,

-- 
Stéphane

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-28 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26 18:07 [Caml-list] Change in typing between OCaml 4.01.0 and 4.02.2 Stéphane Glondu
2015-06-26 19:15 ` Jeremy Yallop
2015-06-28  9:44   ` Jacques Garrigue
2015-06-28 17:04     ` Stéphane Glondu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).