Skip to content

Commit 1b24c9e

Browse files
committed
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 <[email protected]> Run-TryBot: Robert Griesemer <[email protected]> Reviewed-by: Robert Findley <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 07e5527 commit 1b24c9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func testFiles(t *testing.T, filenames []string, colDelta uint, manual bool) {
9999
}
100100

101101
var mode syntax.Mode
102-
if strings.HasSuffix(filenames[0], ".go2") {
102+
if strings.HasSuffix(filenames[0], ".go2") || manual {
103103
mode |= syntax.AllowGenerics
104104
}
105105
// parse files and collect parser errors

src/go/types/check_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func testFiles(t *testing.T, sizes Sizes, filenames []string, srcs [][]byte, man
210210
}
211211

212212
mode := parser.AllErrors
213-
if !strings.HasSuffix(filenames[0], ".go2") {
213+
if !strings.HasSuffix(filenames[0], ".go2") && !manual {
214214
mode |= typeparams.DisallowParsing
215215
}
216216

0 commit comments

Comments
 (0)