Skip to content

Commit

Permalink
typeparams: don't complain that Go 1.17 doesn't support iterators
Browse files Browse the repository at this point in the history
This fixes a test that broke when iterator methods were added
to go/types in CL 575455.

Fixes golang/go#69000

Change-Id: I2c60bbaa3a8c1f059d6d335ec40962e1215375b8
Reviewed-on: https://go-review.googlesource.com/c/exp/+/607895
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
  • Loading branch information
ianlancetaylor authored and gopherbot committed Aug 22, 2024
1 parent 0cdaa3a commit 778ce7b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions typeparams/typeparams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"go/parser"
"go/token"
"go/types"
"strings"
"testing"
)

Expand All @@ -35,6 +36,12 @@ func TestAPIConsistency(t *testing.T) {
delete(api118, name)
}
for name, api := range api118 {
// Go 1.23 has iterator methods that return Seq.
// These methods can't be supported at 1.17.
if strings.Contains(api, "Seq") && api117[name] == "" {
continue
}

if api != api117[name] {
t.Errorf("%q: got %s at 1.18+, but %s at 1.17", name, api, api117[name])
}
Expand Down

0 comments on commit 778ce7b

Please sign in to comment.