Simplify tcheckExpr

This commit is contained in:
Nigel Tao committed 2018-05-14 16:12:24 +10:00
1 parent e00e71da7b
commit a5b4838e8c
1 file changed
+4 -14
+4 -14
View File
@@ -373,23 +373,13 @@ func (q *checker) tcheckExpr(n *a.Expr, depth uint32) error {
switch op := n.Operator(); { switch op := n.Operator(); {
case op.IsXUnaryOp(): case op.IsXUnaryOp():
if err := q.tcheckExprUnaryOp(n, depth); err != nil { return q.tcheckExprUnaryOp(n, depth)
return err
}
case op.IsXBinaryOp(): case op.IsXBinaryOp():
if err := q.tcheckExprBinaryOp(n, depth); err != nil { return q.tcheckExprBinaryOp(n, depth)
return err
}
case op.IsXAssociativeOp(): case op.IsXAssociativeOp():
if err := q.tcheckExprAssociativeOp(n, depth); err != nil { return q.tcheckExprAssociativeOp(n, depth)
return err
}
default:
if err := q.tcheckExprOther(n, depth); err != nil {
return err
}
} }
return nil return q.tcheckExprOther(n, depth)
} }
func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error { func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {