fix: substitute recursive struct type by interface{} in function arguments

This commit is contained in:
Marc Vertes
2020-03-19 12:42:05 +01:00
committed by GitHub
parent daaeac6e2c
commit b52dd8cc08
3 changed files with 28 additions and 3 deletions

View File

@@ -905,6 +905,9 @@ var interf = reflect.TypeOf(new(interface{})).Elem()
func (t *itype) refType(defined map[string]*itype, wrapRecursive bool) reflect.Type {
if t.rtype != nil {
if wrapRecursive && t.cat == structT && defined[t.name] != nil {
return interf
}
return t.rtype
}