diff options
author | Russ Cox <rsc@golang.org> | 2009-05-22 09:53:37 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-05-22 09:53:37 -0700 |
commit | 1c83c4cc0da793b16c1031ee8c70f093230355cd (patch) | |
tree | 0254f8cec8866c12e5a3f8166ac3dd4ed5a7ee65 /test/interface/convert2.go | |
parent | d03e3b6a9e99f67f1af79db91fc0bc5574f52060 (diff) | |
download | golang-1c83c4cc0da793b16c1031ee8c70f093230355cd.tar.gz |
another interface conversion test
R=r
DELTA=21 (21 added, 0 deleted, 0 changed)
OCL=29212
CL=29249
Diffstat (limited to 'test/interface/convert2.go')
-rw-r--r-- | test/interface/convert2.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/interface/convert2.go b/test/interface/convert2.go new file mode 100644 index 000000000..0eff6a95d --- /dev/null +++ b/test/interface/convert2.go @@ -0,0 +1,25 @@ +// $G $D/$F.go && $L $F.$A && ./$A.out + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Check that static interface conversion of +// interface value nil succeeds. + +package main + +type R interface { R(); } +type RW interface { R(); W(); } + +var e interface {} +var r R; +var rw RW; + +func main() { + r = r; + r = rw; + e = r; + e = rw; + rw = rw; +} |