1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
From: Ian Lance Taylor <iant@golang.org>
Date: Thu, 22 Aug 2024 10:38:12 -0700
Subject: typeparams: don't complain that Go 1.17 doesn't support iterators
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>
---
typeparams/typeparams_test.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/typeparams/typeparams_test.go b/typeparams/typeparams_test.go
index 2136a59..e9a4a5b 100644
--- a/typeparams/typeparams_test.go
+++ b/typeparams/typeparams_test.go
@@ -14,6 +14,7 @@ import (
"go/parser"
"go/token"
"go/types"
+ "strings"
"testing"
)
@@ -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])
}
|