fix: compositeSparse handles fields of interface kind

Fixes #776.
This commit is contained in:
Marc Vertes
2020-07-13 17:55:04 +02:00
committed by GitHub
parent 0a79069dfc
commit 5eecbe515b
3 changed files with 47 additions and 0 deletions

View File

@@ -1541,6 +1541,10 @@ func isSendChan(t *itype) bool {
return rt.Kind() == reflect.Chan && rt.ChanDir() == reflect.SendDir
}
func isMap(t *itype) bool { return t.TypeOf().Kind() == reflect.Map }
func isArray(t *itype) bool {
k := t.TypeOf().Kind()
return k == reflect.Array || k == reflect.Slice
}
func isInterfaceSrc(t *itype) bool {
return t.cat == interfaceT || (t.cat == aliasT && isInterfaceSrc(t.val))