From b46d56ae7215ca1f56f4556f76408bab26a85669 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 5 Dec 2012 20:32:12 -0800 Subject: [PATCH] test: add some tests where go/defer arg starts with parenthesis R=gri CC=golang-dev https://golang.org/cl/6890047 --- test/fixedbugs/issue4468.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/fixedbugs/issue4468.go b/test/fixedbugs/issue4468.go index c9d7699e26..ef0b46bcf6 100644 --- a/test/fixedbugs/issue4468.go +++ b/test/fixedbugs/issue4468.go @@ -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() } -- 2.48.1