Source file
test/fixedbugs/issue51401.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 import "runtime"
13
14 type Outer interface{ Inner }
15
16 type impl struct{}
17
18 func New() Outer { return &impl{} }
19
20 type Inner interface {
21 DoStuff() error
22 }
23
24 func (a *impl) DoStuff() error {
25 return newError()
26 }
27
28 func newError() error {
29 stack := make([]uintptr, 50)
30 runtime.Callers(2, stack[:])
31
32 return nil
33 }
34
35 func main() {
36 funcs := listFuncs(New())
37 for _, f := range funcs {
38 f()
39 }
40 }
41
42 func listFuncs(outer Outer) []func() error {
43 return []func() error{outer.DoStuff}
44 }
45
View as plain text