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

Automatic instrumentation via landmarks-ppx and inherited constructors without module name #34

Open
maroneze opened this issue Mar 10, 2022 · 0 comments

Comments

@maroneze
Copy link
Contributor

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.

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

No branches or pull requests

1 participant