diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/go/types/expr.go | 6 | ||||
| -rw-r--r-- | src/go/types/testdata/shifts.src | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/go/types/expr.go b/src/go/types/expr.go index f7c4a17378..4430c45d14 100644 --- a/src/go/types/expr.go +++ b/src/go/types/expr.go @@ -660,10 +660,10 @@ func (check *Checker) shift(x, y *operand, e *ast.BinaryExpr, op token.Token) { return } // rhs must be within reasonable bounds - const stupidShift = 1023 - 1 + 52 // so we can express smallestFloat64 + const shiftBound = 1023 - 1 + 52 // so we can express smallestFloat64 s, ok := constant.Uint64Val(yval) - if !ok || s > stupidShift { - check.invalidOp(y.pos(), "stupid shift count %s", y) + if !ok || s > shiftBound { + check.invalidOp(y.pos(), "invalid shift count %s", y) x.mode = invalid return } diff --git a/src/go/types/testdata/shifts.src b/src/go/types/testdata/shifts.src index 64865fc07b..099c9ecc7c 100644 --- a/src/go/types/testdata/shifts.src +++ b/src/go/types/testdata/shifts.src @@ -10,8 +10,8 @@ func shifts0() { s = 10 _ = 0<<0 _ = 1<<s - _ = 1<<- /* ERROR "stupid shift" */ 1 - _ = 1<<1075 /* ERROR "stupid shift" */ + _ = 1<<- /* ERROR "invalid shift" */ 1 + _ = 1<<1075 /* ERROR "invalid shift" */ _ = 2.0<<1 _ int = 2<<s @@ -338,4 +338,4 @@ func issue11594() { _ = float64 /* ERROR "must be integer" */ (0) >> 2 _ = complex64 /* ERROR "must be integer" */ (0) << 3 _ = complex64 /* ERROR "must be integer" */ (0) >> 4 -}
\ No newline at end of file +} |
