]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/types, types2: always accept type parameters when running Manual test
authorRobert Griesemer <gri@golang.org>
Tue, 19 Oct 2021 20:44:01 +0000 (13:44 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 19 Oct 2021 21:05:11 +0000 (21:05 +0000)
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 <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/compile/internal/types2/check_test.go
src/go/types/check_test.go

index bc68e76407193b493899d35abfaa9ac00211fca3..e71df87f2cafd4d92e6b8369350565169fcb9393 100644 (file)
@@ -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
index e9df90c4ea3c4a55eef229d081e4789a11dc867e..e6176738d1effa438e4eb0ff971ef4cec50f7d48 100644 (file)
@@ -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
        }