summaryrefslogtreecommitdiff
path: root/test/method2.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-04-25 17:16:44 -0400
committerRuss Cox <rsc@golang.org>2011-04-25 17:16:44 -0400
commit92101039b69f59cca5e7f0cd6abebd10b3ea2ed2 (patch)
tree8b90b421a6ad7c218c01297624b22bbf8b42df47 /test/method2.go
parentb63747a747a170cbf05ce259b8b3e4a8376c77ac (diff)
downloadgo-92101039b69f59cca5e7f0cd6abebd10b3ea2ed2.tar.gz
gc: explain why invalid receiver types are invalid
Fixes issue 1680. R=ken2 CC=golang-dev http://codereview.appspot.com/4446061
Diffstat (limited to 'test/method2.go')
-rw-r--r--test/method2.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/method2.go b/test/method2.go
index a72536e7b..2fdc9fc3c 100644
--- a/test/method2.go
+++ b/test/method2.go
@@ -12,8 +12,14 @@ type T struct {
type P *T
type P1 *T
-func (p P) val() int { return 1 } // ERROR "receiver"
-func (p *P1) val() int { return 1 } // ERROR "receiver"
+func (p P) val() int { return 1 } // ERROR "receiver.* pointer"
+func (p *P1) val() int { return 1 } // ERROR "receiver.* pointer"
+
+type I interface{}
+type I1 interface{}
+
+func (p I) val() int { return 1 } // ERROR "receiver.*interface"
+func (p *I1) val() int { return 1 } // ERROR "receiver.*interface"
type Val interface {
val() int