Subject: | Union of class type & role type is broken in 0.32-0.35 |
I'm getting reports that recent versions of MooseX::Types break my
PostScript::Report module. See
https://rt.cpan.org/Ticket/Display.html?id=77299 and
http://www.cpantesters.org/cpan/report/6db9cd6c-a13d-11e1-b2dc-032bf4b14d39
From my testing, it started with MooseX::Types 0.32, and includes all
versions up to and including 0.35.
I've narrowed it down to a union between a role_type and a class_type.
From
https://github.com/madsen/postscript-report/blob/master/lib/PostScript/Report/Types.pm#L55
subtype Container,
as role_type('PostScript::Report::Role::Container');
...
subtype Report,
as class_type('PostScript::Report');
...
subtype Parent,
as Container|Report;
When I try to load PostScript::Report::Types with the current
MooseX::Types, I get: Can't call method "does_role" on an undefined
value at
/usr/lib/perl5/vendor_perl/5.14.2/i686-linux/Moose/Meta/TypeConstraint/Role.pm
line 101. That's with Moose 2.0602.
Interestingly, changing the last line to repeat the definitions allows
the type library to load:
as
role_type('PostScript::Report::Role::Container')|class_type('PostScript::Report');
But that doesn't completely solve the problem, because I still get the
same error when loading PostScript::Report.