diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
commit | 519725bb3c075ee2462c929f5997cb068e18466a (patch) | |
tree | 5b162e8488ad147a645048c073577821b4a2bee9 /test/ddd.go | |
parent | 842623c5dd2819d980ca9c58048d6bc6ed82475f (diff) | |
download | golang-upstream-weekly/2012.03.22.tar.gz |
Imported Upstream version 2012.03.22upstream-weekly/2012.03.22
Diffstat (limited to 'test/ddd.go')
-rw-r--r-- | test/ddd.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/ddd.go b/test/ddd.go index f35836331..01768b89f 100644 --- a/test/ddd.go +++ b/test/ddd.go @@ -60,6 +60,10 @@ type U struct { *T } +type I interface { + Sum(...int) int +} + func main() { if x := sum(1, 2, 3); x != 6 { println("sum 6", x) @@ -207,7 +211,14 @@ func main() { println("i(=u).Sum", x) panic("fail") } - /* TODO(rsc): Enable once nested method expressions work. + var s struct { + I + } + s.I = &u + if x := s.Sum(2, 3, 5, 8); x != 18 { + println("s{&u}.Sum", x) + panic("fail") + } if x := (*U).Sum(&U{}, 1, 3, 5, 2); x != 11 { println("(*U).Sum", x) panic("fail") @@ -216,5 +227,4 @@ func main() { println("U.Sum", x) panic("fail") } - */ } |