summaryrefslogtreecommitdiff
path: root/test/ddd.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/ddd.go')
-rw-r--r--test/ddd.go14
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")
}
- */
}