internal/runtime: NewNamedInterface check exist
This commit is contained in:
@@ -225,6 +225,12 @@ func Func(in, out []*Type, variadic bool) *FuncType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewNamedInterface(pkgPath, name string) *InterfaceType {
|
func NewNamedInterface(pkgPath, name string) *InterfaceType {
|
||||||
|
named := pkgPath + "." + name
|
||||||
|
for _, typ := range rtypeList {
|
||||||
|
if typ.named == named {
|
||||||
|
return typ.InterfaceType()
|
||||||
|
}
|
||||||
|
}
|
||||||
ret := &struct {
|
ret := &struct {
|
||||||
abi.InterfaceType
|
abi.InterfaceType
|
||||||
u abi.UncommonType
|
u abi.UncommonType
|
||||||
@@ -246,6 +252,7 @@ func NewNamedInterface(pkgPath, name string) *InterfaceType {
|
|||||||
PkgPath_: pkgPath,
|
PkgPath_: pkgPath,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
rtypeList = append(rtypeList, &rtype{Type: &ret.Type, named: named})
|
||||||
return &ret.InterfaceType
|
return &ret.InterfaceType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user