From: Robert Griesemer Date: Tue, 19 Oct 2021 20:44:01 +0000 (-0700) Subject: go/types, types2: always accept type parameters when running Manual test X-Git-Tag: go1.18beta1~834 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1b24c9e42e527b93a39b6a6b16c20672dd2d9a03;p=gostls13.git go/types, types2: always accept type parameters when running Manual test This makes it easier to run tests on existing generic code that is not using the `.go2` ending currently used by type checker tests. For #49074. Change-Id: I1501463c55dbe1d709918786e1a43b6d1bf1629a Reviewed-on: https://go-review.googlesource.com/c/go/+/357050 Trust: Robert Griesemer Run-TryBot: Robert Griesemer Reviewed-by: Robert Findley TryBot-Result: Go Bot --- diff --git a/src/cmd/compile/internal/types2/check_test.go b/src/cmd/compile/internal/types2/check_test.go index bc68e76407..e71df87f2c 100644 --- a/src/cmd/compile/internal/types2/check_test.go +++ b/src/cmd/compile/internal/types2/check_test.go @@ -99,7 +99,7 @@ func testFiles(t *testing.T, filenames []string, colDelta uint, manual bool) { } var mode syntax.Mode - if strings.HasSuffix(filenames[0], ".go2") { + if strings.HasSuffix(filenames[0], ".go2") || manual { mode |= syntax.AllowGenerics } // parse files and collect parser errors diff --git a/src/go/types/check_test.go b/src/go/types/check_test.go index e9df90c4ea..e6176738d1 100644 --- a/src/go/types/check_test.go +++ b/src/go/types/check_test.go @@ -210,7 +210,7 @@ func testFiles(t *testing.T, sizes Sizes, filenames []string, srcs [][]byte, man } mode := parser.AllErrors - if !strings.HasSuffix(filenames[0], ".go2") { + if !strings.HasSuffix(filenames[0], ".go2") && !manual { mode |= typeparams.DisallowParsing }