mirror of
https://github.com/golang/go
synced 2024-11-22 21:50:03 -07:00
8c29881dd1
This matches what go/types and types2 report and it also matches the compiler errors reported for some related shift problems. For #55326. Change-Id: Iee40e8d988d5a7f9ff2c49f019884d02485c9fdf Reviewed-on: https://go-review.googlesource.com/c/go/+/436177 Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
16 lines
451 B
Go
16 lines
451 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: shifted operand 1 \(type float64\) must be integer|non-integer type for left operand of shift"
|
|
}
|