From 466ea1f55f17f4d12e3aa42bfce66160e0a9b583 Mon Sep 17 00:00:00 2001 From: Aaron L Date: Sun, 4 Jun 2017 12:03:57 -0700 Subject: [PATCH] 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. --- queries/eager_load.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/queries/eager_load.go b/queries/eager_load.go index 18abcc8..d4ede9c 100644 --- a/queries/eager_load.go +++ b/queries/eager_load.go @@ -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)