error propagation from TypeFunction::semantic

This improves error propagation in TypeFunction::semantic().