This is a simplified example of an issue that happened with Frama-C's visitors:
(* a.ml *)
type visitAction = Go | Skip
class visitor = object
method visit () = Go
end
(* b.ml *)
class skip_visitor = object
inherit A.visitor
method! visit () = Skip (* Could be A.Skip, but due to inheritance, the module name is unnecessary *)
end
OCAML_LANDMARKS=auto ocamlfind ocamlopt -package landmarks -package landmarks-ppx a.ml b.ml
This fails with:
File "b.ml", line 4, characters 21-25:
4 | method! visit () = Skip
^^^^
Error: Unbound constructor Skip
Without Landmarks instrumentation, the above compiles, since the Skip constructor is found in module A.
If I explicitly write A.Skip in b.ml, it works fine.
If this is hard to fix, I believe a small addition to the Known issues section with the workaround should suffice to help people find it. Classes and inheritance are rarely used anyway in OCaml.