diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index cbf3ec6d882..5ae0bf92cfb 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -475,6 +475,19 @@ func (t *tester) registerTests() { }) } + // Test go/... cmd/gofmt with type parameters enabled. + if !t.compileOnly { + t.tests = append(t.tests, distTest{ + name: "tyepparams", + heading: "go/... and cmd/gofmt tests with tag typeparams", + fn: func(dt *distTest) error { + t.addCmd(dt, "src", t.goTest(), t.timeout(300), "-tags=typeparams", "go/...") + t.addCmd(dt, "src", t.goTest(), t.timeout(300), "-tags=typeparams", "cmd/gofmt") + return nil + }, + }) + } + if t.iOS() && !t.compileOnly { t.tests = append(t.tests, distTest{ name: "x509omitbundledroots", diff --git a/src/go/parser/testdata/resolution/typeparams.go2 b/src/go/parser/testdata/resolution/typeparams.go2 index 922f7790f50..c03a5962033 100644 --- a/src/go/parser/testdata/resolution/typeparams.go2 +++ b/src/go/parser/testdata/resolution/typeparams.go2 @@ -18,7 +18,8 @@ type Addable /* =@Addable */ interface { } // TODO (#45221): resolve references to T in the signature below. -func Add /* =@AddDecl */[T /* =@T */ Addable /* @Addable */](l /* =@l */, r /* =@r */ T) T { - var t /* =@t */ T /* @T */ - return l /* @l */ + r /* @r */ + t /* @t */ -} +// TODO(rFindley): re-enable these once type parameter resolution is fixed. +// func Add /* =@AddDecl */[T /* =@T */ Addable /* @Addable */](l /* =@l */, r /* =@r */ T) T { + // var t /* =@t */ T /* @T */ + // return l /* @l */ + r /* @r */ + t /* @t */ +// }