]> Cypherpunks repositories - gostls13.git/commit
go/types: report error for invalid use of ... in parameter lists
authorRobert Griesemer <gri@golang.org>
Mon, 22 Oct 2018 21:07:36 +0000 (14:07 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 22 Oct 2018 22:01:12 +0000 (22:01 +0000)
commit553237aa67a3d0624715973a2dd3e4963e61995d
treeae74e6f76c8436f22a84ac5ed25b753577849f88
parent9258c3f93c92d7b66abe84d2452ad1ce4d80ff7e
go/types: report error for invalid use of ... in parameter lists

The parser accepts ...T types in parameter lists whereever a type
is permitted; this matches the syntax and allows for more tolerant
parsing and error recovery.

go/types on the other hand assumed that the parser would report
those errors and assumed any outstanding such errors would be due
to otherwise manipulated ASTs leading to invalid ASTs.

go/types further assumed that a parameter list (a, b, c ...int)
was permitted (a couple of tests used such parameter lists).

With this CL, go/types now correctly refuses invalid parameter lists.

Fixes #28281.

Change-Id: Ib788255f7b7819fdb972c7801bb153a53ce2ddf7
Reviewed-on: https://go-review.googlesource.com/c/143857
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/api_test.go
src/go/types/testdata/issues.src
src/go/types/typestring_test.go
src/go/types/typexpr.go