mirror of
https://github.com/golang/go
synced 2024-11-27 03:21:18 -07:00
1efc5815dd
Slightly better for cases such as string(1 << s). Leaves type-checker tests alone for now because there are multiple dozens. For #45117. Change-Id: I47b314c713fabe424c2158674bf965416a8a6f5c Reviewed-on: https://go-review.googlesource.com/c/go/+/379274 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
16 lines
426 B
Go
16 lines
426 B
Go
// errorcheck
|
|
|
|
// Copyright 2018 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Non-Go-constant but constant values aren't ok for shifts.
|
|
|
|
package p
|
|
|
|
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"
|
|
}
|