| 1 |
// Copyright 2024 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package testdata |
| 6 |
|
| 7 |
import "iter" |
| 8 |
|
| 9 |
func _(seq1 iter.Seq[int], seq2 iter.Seq2[int, int]) { |
| 10 |
// range-over-func is (once again) consistent with other types (#65236) |
| 11 |
for range "" { // want "simplify range expression" |
| 12 |
} |
| 13 |
for range seq1 { // want `simplify range expression` |
| 14 |
} |
| 15 |
for _, v := range seq2 { // silence |
| 16 |
_ = v |
| 17 |
} |
| 18 |
for range seq2 { // want `simplify range expression` |
| 19 |
} |
| 20 |
} |