The most impressive thing is that this doesn’t cause an infinite recompilation loop. ;)
The way we do this does unfortunately mean that if our heuristic goes very wrong, we can end up doing much more work than is necessary. There are some real nasty cases with self-referential types right now. However, for simple things like changing function bodies, it works lovely!