GoPLS Viewer

Home|gopls/go/callgraph/rta/testdata/rtype.go
1// +build ignore
2
3package main
4
5// Test of runtime types (types for which descriptors are needed).
6
7func use(interface{})
8
9type A byte // neither A nor byte are runtime types
10
11type B struct{ x uint } // B and uint are runtime types, but not the struct
12
13func main() {
14    var x int // not a runtime type
15    print(x)
16
17    var y string // runtime type due to interface conversion
18    use(y)
19
20    use(struct{ uint64 }{}) // struct is a runtime type
21
22    use(new(B)) // *B is a runtime type
23}
24
25// WANT:
26// Dynamic calls
27// Reachable functions
28//   use
29// Reflect types
30//   *B
31//   B
32//   string
33//   struct{uint64}
34//   uint
35//   uint64
36
MembersX
main.BlockStmt.x
main.BlockStmt.y
B.x
Members
X