From 98811f41b8cc65c54d59e8cef8f6eac013dc5a00 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 14 Nov 2009 19:28:13 -0800 Subject: [PATCH] test/interface/receiver.go: expand to do dynamic versions of static checks in receiver1.go R=r https://golang.org/cl/155045 --- test/interface/receiver.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/interface/receiver.go b/test/interface/receiver.go index 438fea0155..87c26937f3 100644 --- a/test/interface/receiver.go +++ b/test/interface/receiver.go @@ -58,6 +58,10 @@ func main() { v.V(); // p = t; // ERROR + var i interface{} = t; + if _, ok := i.(P); ok { + panicln("dynamic i.(P) succeeded incorrectly"); + } // println("--struct--"); var s S; @@ -76,6 +80,10 @@ func main() { v.V(); // p = s; // ERROR + var j interface{} = s; + if _, ok := j.(P); ok { + panicln("dynamic j.(P) succeeded incorrectly"); + } // println("--struct pointer--"); var sp SP;