Fix another occurrency of XSlice cast failures

- When eager loading, we pull the values back out of the R struct, at
  this point it's possible to get the "poisoned" XSlice type that
  nothing can deal with again.
This commit is contained in:
Aaron L 2017-06-04 12:03:57 -07:00
parent 833fd04c6b
commit 466ea1f55f

View file

@ -241,6 +241,9 @@ func collectLoaded(key string, loadingFrom reflect.Value) (reflect.Value, bindKi
if loadedType.Elem().Kind() == reflect.Struct {
bkind = kindStruct
loadedType = reflect.SliceOf(loadedType)
} else {
// Ensure that we get rid of all the helper "XSlice" types
loadedType = reflect.SliceOf(loadedType.Elem())
}
collection := reflect.MakeSlice(loadedType, 0, 0)