Unable to serialize attributes with value of undef
mcmillhj opened this issue · 1 comments
mcmillhj commented
I am not sure whether this is expected behavior, but MooseX::Storage seems to be unable to serialize attributes with a value of undef. Example:
package MyObj;
use Moose;
use MooseX::Storage;
with Storage();
has [qw(a b)] => (
is => 'ro',
required => 1
);
__PACKAGE__->meta->make_immutable;
package main;
use strict;
use warnings;
use Data::Dumper;
my $obj = MyObj->new( a => undef, b => '2' )->pack;
print Dumper $obj;
__END__
$VAR1 = {
'__CLASS__' => 'MyObj',
'b' => '2'
};
If this is expected behavior then that's fine, I can easily use a different default value. If not, I am happy to look into the issue and submit a patch.