fix bug with type checking function calls

the new call is pushed onto the call tree before typechecking is
performed