GoPLS Viewer

Home|gopls/go/callgraph/cha/testdata/issue23925.go
1package main
2
3// Regression test for https://golang.org/issue/23925
4
5type stringFlagImpl string
6
7func (*stringFlagImplSet(s stringerror { return nil }
8
9type boolFlagImpl bool
10
11func (*boolFlagImplSet(s stringerror { return nil }
12func (*boolFlagImplextra()             {}
13
14// A copy of flag.boolFlag interface, without a dependency.
15// Must appear first, so that it becomes the owner of the Set methods.
16type boolFlag interface {
17    flagValue
18    extra()
19}
20
21// A copy of flag.Value, without adding a dependency.
22type flagValue interface {
23    Set(stringerror
24}
25
26func main() {
27    var x flagValue = new(stringFlagImpl)
28    x.Set("")
29
30    var y boolFlag = new(boolFlagImpl)
31    y.Set("")
32}
33
34// WANT:
35// Dynamic calls
36//   main --> (*boolFlagImpl).Set
37//   main --> (*boolFlagImpl).Set
38//   main --> (*stringFlagImpl).Set
39
MembersX
boolFlagImpl.extra
flagValue
main
main.y
boolFlagImpl.Set
boolFlagImpl.Set.s
stringFlagImpl.Set.s
boolFlagImpl
boolFlag
main.x
stringFlagImpl
stringFlagImpl.Set
Members
X