-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Context
If two names refer to the same object, then methods are only considered used when they are manipulated via the original binding.
Example and reproduction
(* /tmp/alias/alias.ml *)
let original =
object
method used = ()
method used_by_alias = ()
end
let alias = original
let () =
original#used;
alias#used_by_alias$ ocamlopt -bin-annot alias.ml
$ dead_code_analyzer --nothing -M all alias.cmi alias.cmt
Scanning files...
[DONE]
.> UNUSED METHODS:
=================
/tmp/alias/alias.ml:2: original#used_by_alias
Nothing else to report in this section
--------------------------------------------------------------------------------
We can see that original#used_by_alias is reported as unused although it is used in alias#used_by_alias.
Reactions are currently unavailable