reanalyze icon indicating copy to clipboard operation
reanalyze copied to clipboard

Binding operators are incorrectly marked dead

Open sim642 opened this issue 3 years ago • 1 comments

Running reanalyze https://github.com/rescript-association/reanalyze/commit/389dd682223201b42c33e5c444e5c79e0805adad on Goblint https://github.com/goblint/analyzer/commit/a544002114324a207df72f9e79eb656c3ebe7b5b revealed the following.

In a file we have this binding operator definition:

let (let+) xs f = List.map f xs

This is marked dead even though the operator is used later in the file. I'm guessing reanalyze just doesn't handle this newer syntactic structure.

sim642 avatar May 17 '22 07:05 sim642

The implementation uses an AST mapper. Looks like this is a let-op, which is handled by ast mappers as a new form of binding. So indeed that seems to be the issue. Also, several versions of typed AST are supported, from 4.06 to latest, so this would need to be injected a bit carefully using the tricks from the Compatibility module.

cristianoc avatar May 18 '22 06:05 cristianoc