Skip to content

Commit

Permalink
Merge pull request #135 from goplus/rtype
Browse files Browse the repository at this point in the history
fix #134: install NamedTypes check struct first
  • Loading branch information
visualfc authored Jul 13, 2022
2 parents 9109baf + 0893b82 commit 7cf6afe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ func (r *TypesLoader) installPackage(pkg *Package) (err error) {
r.InsertInterface(p, name, typ)
}
for name, typ := range pkg.NamedTypes {
r.InsertNamedType(p, name, typ)
if typ.Typ.Kind() == reflect.Struct {
r.InsertNamedType(p, name, typ)
}
}
for name, typ := range pkg.NamedTypes {
if typ.Typ.Kind() != reflect.Struct {
r.InsertNamedType(p, name, typ)
}
}
for name, typ := range pkg.AliasTypes {
r.InsertAlias(p, name, typ)
Expand Down

0 comments on commit 7cf6afe

Please sign in to comment.