Hello, I have some difficulties with compiler plugins for rewriting typed tree. The current implementation of `Typemod.type_implementation` behaves like this (I think): * Checks types in the original implementation module * If corresponding for the implementation `.cmi` file doesn't exist it writes generated interface to the disk. * If a `.cmi` file exists then performs some checks * Applies typed tree hooks. The consequence of this behavior is that the plugin can't add new values to the typed tree, at least they will not appear in the .cmi file. But adding new values during rewriting the typed tree is exactly the thing that I need these days! So, I thought that following pipeline will suit better (steps 2 and 3 are swapped). `Typemod.type_implementation` * Checks types in the original implementation module. * Calls plugins to rewrite this typed tree and get a new typed tree and a signature for it * Creates a `.cmi` file if there are no any or checks that existing `.cmi` file agrees with the signature returned by plugins' hooks. I tried to implement this [1] (the important part of the diff is in the attachment) but I get a crash of `ocamlrun` when building the whole compiler. The patch seems harmless but am I missing something under the hood? Any delayed check that relies on the fact that signature of a module will not change? Am I at least trying to fix in right place? How should I work on crashes like this? Happy hacking, Kakadu [1] https://github.com/Kakadu/ocaml/tree/pptx-fix