[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Change in typing between OCaml 4.01.0 and 4.02.2...



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


Reply to: