internal/lib/reflect: call variadic check

This commit is contained in:
visualfc
2024-11-26 09:50:40 +08:00
parent fadd64c1e9
commit c2138037d2
5 changed files with 407 additions and 111 deletions

View File

@@ -572,7 +572,7 @@ func (t *Type) ExportedMethods() []Method {
func (t *Type) NumMethod() int {
if t.Kind() == Interface {
tt := (*InterfaceType)(unsafe.Pointer(t))
return tt.NumMethod()
return len(tt.Methods)
}
return len(t.ExportedMethods())
}