Skip to content

Commit 879aed3

Browse files
committed
...
1 parent d2be293 commit 879aed3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

state.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,18 @@ func (s *state) assign(dst reflect.Value, value reflect.Value) (reflect.Value, e
342342
fmt.Println("nv.Elem.Type", nv.Elem().Type())
343343
fmt.Println("nv.Elem.IsNil", nv.IsNil())
344344
fmt.Println("dst.Type", dst.Type())
345-
if dst.Type().NumMethod() > 0 && dst.CanInterface() {
345+
if dst.Type().NumMethod() > 0 && dst.CanInterface() && dst.Type().Implements(typeAssigner) {
346346
if assigner, ok := dst.Interface().(Assigner); ok {
347347
fmt.Println("dst.Elem().Type()", dst.Elem().Type())
348+
fmt.Println("dst.Type()", dst.Type())
349+
fmt.Println("dst", litter.Sdump(dst.Interface()))
348350
nve := nv.Elem().Interface()
349351
fmt.Println("nve:", litter.Sdump(nve))
350352
fmt.Println("assigner", assigner)
351353
if assigner == nil {
352354
fmt.Println("wtf is assigner nil for?")
353355
}
354-
assigner.AssignByJSONPointer(&cur, nve)
356+
err = assigner.AssignByJSONPointer(&cur, nve)
355357
if err != nil {
356358
if !errors.Is(err, YieldOperation) {
357359
return dst, newError(err, *s, dst.Elem().Type())

0 commit comments

Comments
 (0)