Split type inference in a new function