Type-check an expression and return the expression's type if type-checking succeeds or an error if type-checking fails
typeWith does not necessarily normalize the type since full normalization is not necessary for just type-checking. If you actually care about the returned type then you may want to normalize it afterwards.
The supplied Context records the types of the names in scope. If these are ill-typed, the return value may be ill-typed.