File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -61,9 +61,14 @@ func (i *Interface) dependsOn(dep Node) bool {
61
61
if dep == i || dep == i .Package {
62
62
return true
63
63
}
64
+ // _, depIsInterface := dep.(*Interface)
64
65
var done bool
65
66
i .TypeDefs .All ()(func (_ string , t * TypeDef ) bool {
66
67
done = DependsOn (t , dep )
68
+ // A type alias transitively pulls in the dependencies of its owner
69
+ if root := t .Root (); ! done && root != t && root .Owner != nil && root .Owner != i {
70
+ done = DependsOn (root .Owner , dep )
71
+ }
67
72
return ! done
68
73
})
69
74
if done {
Original file line number Diff line number Diff line change @@ -27,10 +27,12 @@ func DependsOn(node, dep Node) bool {
27
27
if node == dep {
28
28
return true
29
29
}
30
+
30
31
// Dereference InterfaceRefs
31
32
if ref , ok := dep .(* InterfaceRef ); ok {
32
33
dep = ref .Interface
33
34
}
35
+
34
36
// TODO: is it harmful to despecialize before doing dependency check?
35
37
// e.g. it breaks the node == dep check?
36
38
if k , ok := node .(TypeDefKind ); ok {
@@ -39,6 +41,7 @@ func DependsOn(node, dep Node) bool {
39
41
if d , ok := node .(dependent ); ok {
40
42
return d .dependsOn (dep )
41
43
}
44
+
42
45
return false
43
46
}
44
47
You can’t perform that action at this time.
0 commit comments