]> Cypherpunks repositories - gostls13.git/commitdiff
test: add some tests where go/defer arg starts with parenthesis
authorIan Lance Taylor <iant@golang.org>
Thu, 6 Dec 2012 04:32:12 +0000 (20:32 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 6 Dec 2012 04:32:12 +0000 (20:32 -0800)
R=gri
CC=golang-dev
https://golang.org/cl/6890047

test/fixedbugs/issue4468.go

index c9d7699e269e033c60c2f8a06d2a95b6c1ea43b3..ef0b46bcf6829ba8c8aa517a5b57c134473b5510 100644 (file)
@@ -8,7 +8,21 @@
 
 package p
 
+type T int
+
+func (t *T) F() T {
+       return *t
+}
+
+type S struct {
+       t T
+}
+
 func F() {
        go (F())        // ERROR "must be function call"
        defer (F())     // ERROR "must be function call"
+       var s S
+       (&s.t).F()
+       go (&s.t).F()
+       defer (&s.t).F()
 }