LexiFi / landmarks

A Simple Profiling Library for OCaml
MIT License
129 stars 20 forks source link

Let-in-annotation may introduce "unused variables" #9

Open mlasson opened 7 years ago

mlasson commented 7 years ago

For instance:

let () = 
  let[@landmark] rec f () = ()
  and g () = f () in 
  g ()

will produce unused variable "f". This is a bug in the ppx "translation".

On the other hand, the warning will disappear with:

let f = ()
let () = 
  let[@landmark] rec f () = ()
  and g () = f () in 
  g ()

this seems to be a bug in the ocaml compiler.