From 778ce7bba035e9741d3cf7053ebd3f2968c0a4b2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 22 Aug 2024 10:38:12 -0700 Subject: [PATCH] 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 LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Alan Donovan --- typeparams/typeparams_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/typeparams/typeparams_test.go b/typeparams/typeparams_test.go index 2136a598..e9a4a5b9 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]) }