validate return types and number of arguments/return values