While playing with ppx, I accidentally produced some 0-ary function applications. They successfully pass -dsource, typechecker, ocamlc bytecode backend and sometimes result in a segmentation fault in ocamlrun, like this: https://gist.github.com/whitequark/558574ce2f5be4550215 [^]

As I've said, they segfault *sometimes*, which is why writing a minimal testcase proved hard. However, I have a branch of ppx_protobuf whose testsuite reliably crashes.

Indeed, we should make the compiler much more robust by checking invariants on the Parsetree which are assumed and currently enforced by the parser (but not by -pp / -ppx). This is one more instance of it.