Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lang/golang/parser/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,11 @@ func (ctx *fileContext) getTypeinfo(typ types.Type) (ti typeInfo) {
ti.IsStdOrBuiltin = true
}
// collect sub Named type here
for i := 1; i < len(tobjs); i++ {
i := 0
if isNamed {
i = 1
}
for ; i < len(tobjs); i++ {
tobj := tobjs[i]
if isGoBuiltins(tobj.Name()) {
continue
Expand Down
5 changes: 5 additions & 0 deletions lang/golang/parser/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,11 @@ func (p *GoParser) parseInterface(ctx *fileContext, name *ast.Ident, decl *ast.I
fn.IsMethod = true
fn.IsInterfaceMethod = true
fn.Signature = string(ctx.GetRawContent(fieldDecl))
// collect func signature deps
ty := ctx.GetTypeInfo(fieldDecl.Type)
for _, dep := range ty.Deps {
fn.Types = InsertDependency(fn.Types, NewDependency(dep, ctx.FileLine(fieldDecl)))
}
}
p.collectTypes(ctx, fieldDecl.Type, st, inlined)
}
Expand Down
4 changes: 4 additions & 0 deletions testdata/go/0_golang/pkg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,7 @@ var CaseVarFunc CaseStruct = func() CaseStruct {
FieldExternalType: entity.MyStruct{},
}
}()

type CaseInterface interface {
CaseMethodDeps(a int, b entity.MyStruct) Integer
}
Loading