1
0
mirror of https://github.com/golang/go synced 2024-11-17 17:24:45 -07:00

go/types, types2: add an additional shift test case

The extra test just confirms that the type-checker internally
agrees with the spec with the (otherwise invisible) type given
to an untyped constant in a specific shift expression.

For #48422.

Change-Id: I6d98045f90bd20b0cc0a96a147bec9701039cb07
Reviewed-on: https://go-review.googlesource.com/c/go/+/350410
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2021-09-16 15:09:31 -07:00
parent 5402b4376c
commit e09dcc211a
2 changed files with 2 additions and 0 deletions

View File

@ -145,6 +145,7 @@ func TestValuesInfo(t *testing.T) {
{`package f7b; var _ = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`}, {`package f7b; var _ = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`},
{`package g0; const (a = len([iota]int{}); b; c); const _ = c`, `c`, `int`, `2`}, // issue #22341 {`package g0; const (a = len([iota]int{}); b; c); const _ = c`, `c`, `int`, `2`}, // issue #22341
{`package g1; var(j int32; s int; n = 1.0<<s == j)`, `1.0`, `int32`, `1`}, // issue #48422
} }
for _, test := range tests { for _, test := range tests {

View File

@ -152,6 +152,7 @@ func TestValuesInfo(t *testing.T) {
{`package f7b; var _ = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`}, {`package f7b; var _ = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`},
{`package g0; const (a = len([iota]int{}); b; c); const _ = c`, `c`, `int`, `2`}, // issue #22341 {`package g0; const (a = len([iota]int{}); b; c); const _ = c`, `c`, `int`, `2`}, // issue #22341
{`package g1; var(j int32; s int; n = 1.0<<s == j)`, `1.0`, `int32`, `1`}, // issue #48422
} }
for _, test := range tests { for _, test := range tests {