// We already know from the shift check that it is representable
// as an integer if it is a constant.
if !allInteger(typ) {
- if check.conf.CompilerErrorMessages {
- check.errorf(x, _InvalidShiftOperand, invalidOp+"%s (shift of type %s)", parent, typ)
- } else {
- check.errorf(x, _InvalidShiftOperand, invalidOp+"shifted operand %s (type %s) must be integer", x, typ)
- }
+ check.errorf(x, _InvalidShiftOperand, invalidOp+"shifted operand %s (type %s) must be integer", x, typ)
return
}
// Even if we have an integer, if the value is a constant we
// We already know from the shift check that it is representable
// as an integer if it is a constant.
if !allInteger(typ) {
- if compilerErrorMessages {
- check.invalidOp(x, _InvalidShiftOperand, "%s (shift of type %s)", parent, typ)
- } else {
- check.invalidOp(x, _InvalidShiftOperand, "shifted operand %s (type %s) must be integer", x, typ)
- }
+ check.invalidOp(x, _InvalidShiftOperand, "shifted operand %s (type %s) must be integer", x, typ)
return
}
// Even if we have an integer, if the value is a constant we
import "unsafe"
func f() {
- _ = complex(1<<uintptr(unsafe.Pointer(nil)), 0) // ERROR "invalid operation: .*shift of type float64.*|non-integer type for left operand of shift"
+ _ = complex(1<<uintptr(unsafe.Pointer(nil)), 0) // ERROR "invalid operation: shifted operand 1 \(type float64\) must be integer|non-integer type for left operand of shift"
}