Subject: | Cannot define a second union of the same class_types |
Failing test pasted in:
#!perl
use Test::More;
use Test::Requires {
'MooseX::Types' => '0.23', # skip all if not installed
};
{
package Zapit;
use MooseX::Types -declare => [qw(FooType BarType BazType QuuxType FooX
BarX BazX)];
subtype FooType, as class_type('Foo');
subtype BarType, as class_type('Bar');
subtype BazType, as class_type('Baz');
subtype QuuxType, as class_type('Quux');
subtype FooX, as FooType | BarType | BazType | QuuxType;
subtype BarX, as FooType | BarType | BazType;
# Trying to make this use Test::Exception instead makes the test
pass.
eval {
subtype BazX, as FooType | BarType | BazType;
}
}
ok(not defined $@, 'Second subtype with same union of subtypes should
not die.');
done_testing;