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:
parent
6cd21e820b
commit
f38fc6a97a
|
@ -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() {}
|
||||
|
|
Loading…
Reference in New Issue