mirror of
https://github.com/golang/go
synced 2024-10-14 11:53:56 +00:00
test: add some tests where go/defer arg starts with parenthesis
R=gri CC=golang-dev https://golang.org/cl/6890047
This commit is contained in:
parent
5416e6e916
commit
b46d56ae72
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue