ppxlib icon indicating copy to clipboard operation
ppxlib copied to clipboard

locations check fails for let+ operators

Open ceastlund opened this issue 3 years ago • 0 comments

Apparently the ocaml parser gives the body of a let+ the same location as the whole let+ expression. This makes the locations check in ppxlib fail for any ppx that returns a let+ expression that was part of the user's code in the first place.

Example using ppx_let:

let () = let%bind () = () in let+ () = () in ()

This complains about the final body () overlapping with the let+ because the expansion of %bind included that code, even though it was part of the source code to begin with. The set of exceptions for the locations check needs to be extended to include this.

ceastlund avatar Jun 10 '22 17:06 ceastlund