ocaml-monadic icon indicating copy to clipboard operation
ocaml-monadic copied to clipboard

When [%guard] does not expand, error message could be better

Open zepalmer opened this issue 8 years ago • 2 comments

In this library, the extension [%guard] must appear as the first operand of the operator ;. If it appears anywhere else, it does not get processed. This is fine, but the extension is currently ignored in that case and the resulting error message from the OCaml compiler is not very helpful. Investigate improving the error message for this case.

zepalmer avatar Mar 29 '17 04:03 zepalmer

Maybe it would be useful to catch all guard instances but replace any other than the "right" ones with [%ocaml.error "a guard is not allowed in this context"] or something similar.

hcarty avatar Mar 29 '17 04:03 hcarty

That kind of error message would honestly be useful in lots of ppxs using extension points...

hcarty avatar Mar 29 '17 04:03 hcarty