-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deep nested objects fix (RT Bug #81236) #7
base: master
Are you sure you want to change the base?
Conversation
On Fri, May 30, 2014 at 03:07:21AM -0700, Dmitry Latin wrote:
Awesome, thanks! |
Thanks! I've merged this with some very small amendments for style to minimize the diffs, and squashed the test commits together with their corresponding .pm fixes. |
This closes #7, Deep nested objects fix (RT Bug #81236) Wrong packing/unpacking for nested objects ```perl my $obj = StorableClass->new( h => { a => [ StorableClass->new(s => 'value'), ... ], ... } ); my $hashref = $obj->pack; ``` Packs into: ```perl { __CLASS__ => 'StorableClass', h => { a => [ bless({s => 'value'}, 'StorableClass') ] # Blessed! XXX } } ```
I'm terribly sorry, but I've reverted these changes in release 0.50. While mostly only new features are added, some existing behaviour has changed (see https://rt.cpan.org/Ticket/Display.html?id=104106), and until we can at least successfully pack/unpack as many objects as we could before, this feature can't be released as stable. I've added a TODO test (t/080) which demonstrates a usecase that doesn't work that ought to, and created a new branch (https://github.com/moose/MooseX-Storage/tree/topic/deep-pack-unpack) which re-adds these changes, along with one fix that I was able to identify. The unpacking case for Sorry again. This is a desirable feature, but it needs more iterations and testing first (and a -TRIAL release - that was an error on my part sending it out as stable right away). |
… and unpack deeply nested objects." This reverts commit e6c72a8. This re-adds the original code from PR#7.
…t before attempting to call $thing->pack
Probably
Because
couldn't be converted into objects. PS: actually it could, but |
This doesn't work -- anything used in It should be possiblefor the type handlers to handle any type -- the trick is that the ArrayRef and HashRef expand subs need to recurse into the type constraint to find the root type (and if we're unpacking something like I had an experimental code diff that looked like this:
|
Take a look to last commit 7e73099 |
45d247a
to
8a1608b
Compare
Wrong packing/unpacking for nested objects
Packs into: