File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,12 @@ type field struct {
106
106
}
107
107
108
108
func (f field ) Type () types.Type {
109
- s := f .StructType . Underlying ( ).(* types.Struct )
109
+ s := typeparams . CoreType ( f .StructType ).(* types.Struct )
110
110
return s .Field (f .index ).Type ()
111
111
}
112
112
113
113
func (f field ) String () string {
114
- s := f .StructType . Underlying ( ).(* types.Struct )
114
+ s := typeparams . CoreType ( f .StructType ).(* types.Struct )
115
115
return fmt .Sprintf ("Field(%v:%s)" , f .StructType , s .Field (f .index ).Name ())
116
116
}
117
117
@@ -434,7 +434,7 @@ func (b *builder) field(f *ssa.Field) {
434
434
}
435
435
436
436
func (b * builder ) fieldAddr (f * ssa.FieldAddr ) {
437
- t := f .X .Type (). Underlying ( ).(* types.Pointer ).Elem ()
437
+ t := typeparams . CoreType ( f .X .Type ()).(* types.Pointer ).Elem ()
438
438
439
439
// Since we are getting pointer to a field, make a bidirectional edge.
440
440
fnode := field {StructType : t , index : f .Field }
Original file line number Diff line number Diff line change
1
+ package test
2
+
3
+ type embedded struct {}
4
+
5
+ type S struct { embedded }
6
+
7
+ func (_ S ) M () {}
8
+
9
+ type C interface {
10
+ M ()
11
+ S
12
+ }
13
+
14
+ func G [T C ]() {
15
+ t := T {embedded {}}
16
+ t .M ()
17
+ }
18
+
19
+ func F () {
20
+ G [S ]()
21
+ }
22
+
23
+ // WANT:
24
+ // F: G[testdata.S]() -> G[testdata.S]
25
+ // G[testdata.S]: (S).M(t2) -> S.M
26
+ // S.M: (testdata.S).M(t1) -> S.M
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ func TestVTACallGraphGenerics(t *testing.T) {
127
127
files := []string {
128
128
"testdata/src/arrays_generics.go" ,
129
129
"testdata/src/callgraph_generics.go" ,
130
+ "testdata/src/issue63146.go" ,
130
131
}
131
132
for _ , file := range files {
132
133
t .Run (file , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments