0
1
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 .
Fixes .

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:
Robert Griesemer
2022-01-18 15:21:37 -08:00
parent fa4df6597e
commit 50869f377f
9 changed files with 23 additions and 11 deletions
src
cmd
compile
internal
go
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
}