diff options
Diffstat (limited to 'test/interface/explicit.go')
-rw-r--r-- | test/interface/explicit.go | 8 |
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 |