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(); {
case op.IsXUnaryOp():
if err := q.tcheckExprUnaryOp(n, depth); err != nil {
return err
}
return q.tcheckExprUnaryOp(n, depth)
case op.IsXBinaryOp():
if err := q.tcheckExprBinaryOp(n, depth); err != nil {
return err
}
return q.tcheckExprBinaryOp(n, depth)
case op.IsXAssociativeOp():
if err := q.tcheckExprAssociativeOp(n, depth); err != nil {
return err
}
default:
if err := q.tcheckExprOther(n, depth); err != nil {
return err
}
return q.tcheckExprAssociativeOp(n, depth)
}
return nil
return q.tcheckExprOther(n, depth)
}
func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {