mirror of
https://github.com/golang/go
synced 2025-05-08 03:47:36 +00:00
go/types, types2: report error for invalid string(1 << s)
For #45114. Fixes #45117. Change-Id: I71d6650ae2c4c06952fce19959120f15f13c08a2 Reviewed-on: https://go-review.googlesource.com/c/go/+/379256 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
src
cmd
compile
internal
types2
go
types
test/fixedbugs
@ -11,8 +11,6 @@ func main() {
|
||||
ss := 1 << s
|
||||
y1 := float64(ss)
|
||||
y2 := float64(1 << s) // ERROR "shift"
|
||||
// see issues #45114, #45117
|
||||
// y3 := string(1 << s) // DISABLED "shift"
|
||||
y3 := 0
|
||||
y3 := string(1 << s) // ERROR "shift"
|
||||
_, _, _, _, _ = s, ss, y1, y2, y3
|
||||
}
|
||||
|
Reference in New Issue
Block a user