fix(go_indexer): check whether embedded type is Named
@@ -538,10 +538,12 @@ func (e *emitter) visitTypeSpec(spec *ast.TypeSpec, stack stackFunc) {
}
// Mark the interface as an extension of any embedded interfaces.
for i, n := 0, t.NumEmbeddeds(); i < n; i++ {
- if eobj := t.Embedded(i).Obj(); e.checkImplements(obj, eobj) {
+ if named, ok := t.EmbeddedType(i).(*types.Named); ok {
+ if eobj := named.Obj(); e.checkImplements(obj, eobj) {
e.writeEdge(target, e.pi.ObjectVName(eobj), edges.Extends)
}
}
+ }
// Add bindings for the explicitly-named methods in this declaration.
// Parent edges were already added, so skip them here.
