summaryrefslogtreecommitdiff
path: root/test/interface/explicit.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:43 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:43 +0100
commitad47422646a18ffcb47cec916ef7393c923f2e76 (patch)
tree7c7861fb3d9539d61c1dcfd5b8dadee974c25760 /test/interface/explicit.go
parent2c8d5d584a79781ca41bb6f4b396893fbbac5b97 (diff)
parent04b08da9af0c450d645ab7389d1467308cfc2db8 (diff)
downloadgolang-ad47422646a18ffcb47cec916ef7393c923f2e76.tar.gz
Merge tag 'upstream/1.1_hg20130304' into debian-sid
Upstream version 1.1~hg20130304
Diffstat (limited to 'test/interface/explicit.go')
-rw-r--r--test/interface/explicit.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/interface/explicit.go b/test/interface/explicit.go
index d19480a68..eb81156e0 100644
--- a/test/interface/explicit.go
+++ b/test/interface/explicit.go
@@ -15,6 +15,10 @@ type T struct {
var t *T
+type X int
+
+func (x *X) M() {}
+
type I interface {
M()
}
@@ -40,7 +44,7 @@ func main() {
// because i has an extra method
// that t does not, so i cannot contain a t.
i = t // ERROR "incompatible|missing M method"
- t = i // ERROR "incompatible|need type assertion"
+ t = i // ERROR "incompatible|assignment$"
i = i2 // ok
i2 = i // ERROR "incompatible|missing N method"
@@ -66,6 +70,8 @@ func (Int) M(float64) {}
var _ = m.(Int) // ERROR "impossible type assertion"
+var _ = m.(X) // ERROR "pointer receiver"
+
var ii int
var jj Int