Skip to content

Commit

Permalink
Use the current visitor to populate closure vars
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Jul 5, 2024
1 parent 98b6ab4 commit 7bb67ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ func (d *Deserializer) VisitFunc(ctx reflectext.VisitContext, v reflect.Value) b
fv := reflectext.FuncValueOf(v)
if fn.Closure != nil {
closure := reflect.New(fn.Closure).Elem()
d.Deserialize(closure)
fv.SetClosure(fn.Addr, closure)
} else {

fv.SetAddr(fn.Addr)
}
return false
return true
}

func (s *Serializer) VisitPointer(ctx reflectext.VisitContext, v reflect.Value) bool {
Expand Down

0 comments on commit 7bb67ac

Please sign in to comment.