Correct way of extending the context of the typechecker