|Subject:||Union of multiple enums not supported|
An attribute with a type consisting of two enums in a union cannot be serialised. See attached file for minimal example. Running this produces: Cannot handle type constraint (myType) at /usr/local/share/perl/5.10.0/MooseX/Storage/Engine.pm line 355 Changing the example to just use 'foo' in the subtype works. I can probably have a go at patching this if necessary...
package TestStorage; use Moose; use Moose::Util::TypeConstraints; use MooseX::Storage; with Storage; enum "foo" => qw(bar baz); enum "quxx" => qw(yada foobar); subtype "myType" => as("foo|quxx"); has 'blah' => is => "ro", isa => "myType", required => 1, ; package main; use Data::Dumper; my $test = TestStorage->new(blah => 'bar'); print Dumper $test->pack;