diff options
Diffstat (limited to 'src/go/types/expr.go')
-rw-r--r-- | src/go/types/expr.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/go/types/expr.go b/src/go/types/expr.go index 977153512f..70914d5485 100644 --- a/src/go/types/expr.go +++ b/src/go/types/expr.go @@ -87,7 +87,7 @@ func (check *Checker) op(m opPredicates, x *operand, op token.Token) bool { // overflow checks that the constant x is representable by its type. // For untyped constants, it checks that the value doesn't become // arbitrarily large. -func (check *Checker) overflow(x *operand, op token.Token, opPos token.Pos) { +func (check *Checker) overflow(x *operand, opPos token.Pos) { assert(x.mode == constant_) if x.val.Kind() == constant.Unknown { @@ -115,8 +115,8 @@ func (check *Checker) overflow(x *operand, op token.Token, opPos token.Pos) { } } -// opName returns the name of an operation, or the empty string. -// Only operations that might overflow are handled. +// opName returns the name of the operation if x is an operation +// that might overflow; otherwise it returns the empty string. func opName(e ast.Expr) string { switch e := e.(type) { case *ast.BinaryExpr: @@ -213,7 +213,7 @@ func (check *Checker) unary(x *operand, e *ast.UnaryExpr) { } x.val = constant.UnaryOp(e.Op, x.val, prec) x.expr = e - check.overflow(x, e.Op, x.Pos()) + check.overflow(x, x.Pos()) return } @@ -991,7 +991,7 @@ func (check *Checker) shift(x, y *operand, e ast.Expr, op token.Token) { if b, _ := e.(*ast.BinaryExpr); b != nil { opPos = b.OpPos } - check.overflow(x, op, opPos) + check.overflow(x, opPos) return } @@ -1171,7 +1171,7 @@ func (check *Checker) binary(x *operand, e ast.Expr, lhs, rhs ast.Expr, op token } x.val = constant.BinaryOp(x.val, op, y.val) x.expr = e - check.overflow(x, op, opPos) + check.overflow(x, opPos) return } |