go.tools/go/types: add test cases for parenthesized receivers

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/101510043
This commit is contained in:
Robert Griesemer 2014-06-26 09:48:58 -07:00
parent 6cd21e820b
commit f38fc6a97a
1 changed files with 12 additions and 0 deletions

View File

@ -51,3 +51,15 @@ func (Foo /* ERROR "undeclared" */ ) m() int { return "foo" /* ERROR "cannot con
func (Foo /* ERROR "undeclared" */ ) _() {}
func (Foo /* ERROR "undeclared" */ ) _(undeclared /* ERROR "undeclared" */ ) {}
func (Foo /* ERROR "undeclared" */ ) _() int { return "foo" /* ERROR "cannot convert" */ }
// Receiver declarations are regular parameter lists;
// receiver types may use parentheses, and the list
// may have a trailing comma.
type T7 struct {}
func (T7) m1() {}
func ((T7)) m2() {}
func ((*T7)) m3() {}
func (x *(T7),) m4() {}
func (x (*(T7)),) m5() {}
func (x ((*((T7)))),) m6() {}