Kakadu / zanuda

OCaml linter
GNU Lesser General Public License v3.0
66 stars 8 forks source link

Usage of ppx_let gives false positive(?) #45

Open NightBlues opened 7 months ago

NightBlues commented 7 months ago

Code like this

let%bind res = somefunc ... in
match res with
...

triggers Using 'function' is recommended alert, though we can't really rewrite this with function.

Kakadu commented 7 months ago

Yes, it is a kind of false positive. This happens because zanuda analyses typedtree, i.e. the code after macro expansion. This happens also with other syntax extension, AFAIR ppx_show.

The proper way to fix it would be to lookup for function in the parsetree at the same location where it is found in typedtree, but this is not currently implemented.