From: Russ Cox Date: Sun, 15 Nov 2009 03:28:13 +0000 (-0800) Subject: test/interface/receiver.go: expand to do dynamic X-Git-Tag: weekly.2009-11-17~61 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=98811f41b8cc65c54d59e8cef8f6eac013dc5a00;p=gostls13.git test/interface/receiver.go: expand to do dynamic versions of static checks in receiver1.go R=r https://golang.org/cl/155045 --- 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;