semantic: Ensure that rewritten nested functions are in fact nested.