diff options
author | Russ Cox <rsc@golang.org> | 2009-11-14 19:28:13 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-11-14 19:28:13 -0800 |
commit | 98811f41b8cc65c54d59e8cef8f6eac013dc5a00 (patch) | |
tree | 8ed660485a743d3cefadec8f9b2e8e441b795665 /test/interface | |
parent | 553be8427ed619cff7f4e58e4a0dd8d858b49d26 (diff) | |
download | go-98811f41b8cc65c54d59e8cef8f6eac013dc5a00.tar.gz go-98811f41b8cc65c54d59e8cef8f6eac013dc5a00.zip |
test/interface/receiver.go: expand to do dynamic
versions of static checks in receiver1.go
R=r
https://golang.org/cl/155045
Diffstat (limited to 'test/interface')
-rw-r--r-- | test/interface/receiver.go | 8 |
1 files changed, 8 insertions, 0 deletions
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; |