3 // Copyright 2018 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
10 func f(p, q *struct{}) bool {
20 func g(p, q *T) bool {
25 func h(p, q func() struct{}) bool {
29 func fi(p, q *struct{}) bool {
33 func gi(p, q *T) bool {
37 func hi(p, q func() struct{}) bool {
42 shouldPanic(func() { f(nil, nil) })
43 shouldPanic(func() { g(nil, nil) })
44 shouldPanic(func() { h(nil, nil) })
45 shouldPanic(func() { fi(nil, nil) })
46 shouldPanic(func() { gi(nil, nil) })
47 shouldPanic(func() { hi(nil, nil) })
49 inc := func() struct{} {
55 panic("inc not called")
59 panic("inc not called")
63 func shouldPanic(x func()) {
66 panic("did not panic")