Type checking for Expr