store errors so they can be checked in test cases
begin type checker