mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile/internal/syntax: type parameters must always be named
Report an error otherwise. Change-Id: Ia76ea03a3f26b13dd9bca49f7bd42101d1ff1f9e Reviewed-on: https://go-review.googlesource.com/c/go/+/278475 Trust: Robert Griesemer <gri@golang.org> Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
parent
3b5918c757
commit
7909d6ec28
3 changed files with 51 additions and 11 deletions
|
|
@ -128,6 +128,10 @@ func testSyntaxErrors(t *testing.T, filename string) {
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
var mode Mode
|
||||
if strings.HasSuffix(filename, ".go2") {
|
||||
mode = AllowGenerics
|
||||
}
|
||||
ParseFile(filename, func(err error) {
|
||||
e, ok := err.(Error)
|
||||
if !ok {
|
||||
|
|
@ -162,7 +166,7 @@ func testSyntaxErrors(t *testing.T, filename string) {
|
|||
} else {
|
||||
t.Errorf("%s: unexpected error: %s", orig, e.Msg)
|
||||
}
|
||||
}, nil, 0)
|
||||
}, nil, mode)
|
||||
|
||||
if *print {
|
||||
fmt.Println()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue