]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] go/parser: accept "~" and "|" interface elements
authorRob Findley <rfindley@google.com>
Mon, 7 Jun 2021 14:04:12 +0000 (10:04 -0400)
committerRobert Findley <rfindley@google.com>
Thu, 17 Jun 2021 02:06:03 +0000 (02:06 +0000)
commitab4b3c4b15838e3eb5888b96c7965e31973b25cd
tree557cfbbfdd959446826cb2d3cbff836044ac389d
parent7c5d7a4caffdb72ce252fb465ff4f7fd62a46c8a
[dev.typeparams] go/parser: accept "~" and "|" interface elements

This is a port of CL 307371 to go/parser, adding support for the new
embedded type expressions. As in that CL, type lists continue to be
accepted.

This CL also revealed a pre-existing bug related to embedded instances:
the parser was failing to parse embedded instances with multiple type
arguments, due to not consuming the initial ','. This is fixed, and
along the way TestErrors is modified to use subtests.

Several missing tests cases were added to exprstring_test.go. These must
have been missed in an earlier CL.

Change-Id: I452769536998cddb1618bebdba675fc09d48a12f
Reviewed-on: https://go-review.googlesource.com/c/go/+/325690
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/parser/error_test.go
src/go/parser/parser.go
src/go/parser/testdata/interface.go2 [new file with mode: 0644]
src/go/types/exprstring_test.go