ensure a final return after inlining, if necessary