diff options
author | Robert Griesemer <gri@golang.org> | 2020-10-13 22:33:17 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2020-10-14 21:37:37 +0000 |
commit | 73f529845c91818c58f26994099db17c8ee2b2f3 (patch) | |
tree | 5ce5467ee357cc70725e665ad6966c494b1480fd /src/cmd/compile/internal/syntax/parser_test.go | |
parent | 48755e06aa2ed6ec977efc6df976bcc375a2e6f2 (diff) | |
download | go-73f529845c91818c58f26994099db17c8ee2b2f3.tar.gz go-73f529845c91818c58f26994099db17c8ee2b2f3.zip |
[dev.typeparams] cmd/compile/internal/syntax: always use IndexExpr node for type instantiation
Per @mdempsky's suggestion: Instead of representing a type instantiation T[P]
by an IndexExpr node, and a type instantiation with multiple type arguments
T[P1, P2] by a CallExpr node with special Brackets flag, always use an IndexExpr.
Use a ListExpr as index in the (less common) case of multiple type arguments.
This removes the need for the CallExpr.Brackets field and cleans up the parser
code around type instantiations.
Backport of syntax package changes from https://golang.org/cl/262020.
Change-Id: I32e8bc4eafac5b3ef2e7eb40fa8c790a5a905b69
Reviewed-on: https://go-review.googlesource.com/c/go/+/262137
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/parser_test.go')
-rw-r--r-- | src/cmd/compile/internal/syntax/parser_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/syntax/parser_test.go b/src/cmd/compile/internal/syntax/parser_test.go index e270879739..70651efeae 100644 --- a/src/cmd/compile/internal/syntax/parser_test.go +++ b/src/cmd/compile/internal/syntax/parser_test.go @@ -26,7 +26,7 @@ var ( ) func TestParse(t *testing.T) { - ParseFile(*src_, func(err error) { t.Error(err) }, nil, 0) + ParseFile(*src_, func(err error) { t.Error(err) }, nil, AllowGenerics) } func TestParseGo2(t *testing.T) { |