Arguments of class declarations cannot be spotted at error

Issue #27 new
repo owner created an issue

We cannot spot x in the following definition:

class type t = object
  method m : int
  method n : int

class c x : t = object
  method m = x + 1

This is OCaml 4.00.1's problem. If we make the above well typed by adding method n, then at the position of the argument x, we see 2 val x str_item deifinitions. In the ill-typed version, there is only one. The missing one provides the link between the argument and the use. (You can verify it by ocamlspot --dump-tree).

Comments (1)

  1. camlspotter reporter

    As I have described above, this is not a bug of ocamlspot but an issue of OCaml compiler. Hope it is fixed in 4.01.0.

    For the future reference I added tests/ .

  2. Log in to comment