Skip to content

Commit b0680b4

Browse files
committed
go/types: add test verifying corner-case behavior of iota
For #22341. Change-Id: I7e586c58075e4c835ef97701db2f38bdf7558521 Reviewed-on: https://go-review.googlesource.com/71974 Run-TryBot: Robert Griesemer <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 85177f4 commit b0680b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/go/types/api_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ func TestValuesInfo(t *testing.T) {
118118
{`package f7a; var _ complex128 = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`},
119119
{`package f6b; var _ = 1e-2000i`, `1e-2000i`, `complex128`, `(0 + 0i)`},
120120
{`package f7b; var _ = -1e-2000i`, `-1e-2000i`, `complex128`, `(0 + 0i)`},
121+
122+
{`package g0; const (a = len([iota]int{}); b; c); const _ = c`, `c`, `int`, `2`}, // issue #22341
121123
}
122124

123125
for _, test := range tests {

0 commit comments

Comments
 (0)