Skip Menu |

This queue is for tickets about the namespace-autoclean CPAN distribution.

Report information
The Basics
Id: 98424
Status: resolved
Priority: 0/
Queue: namespace-autoclean

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.20
Fixed in: 0.20



Subject: Bad interaction with oldish version of Moose
$ perl -MMooseX::Types::Moose -e1 Can't call method "can" on an undefined value at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/i686-linux-thread-multi/Moose/Object.pm line 124. Compilation failed in require. BEGIN failed--compilation aborted. $ perl -MCarp::Always -MMooseX::Types::Moose -e1 Can't call method "can" on an undefined value at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/i686-linux-thread-multi/Moose/Object.pm line 124 Moose::Object::does('MooseX::Types::Moose', 'Moose::Util::TypeConstraints') called at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/namespace/autoclean.pm line 200 namespace::autoclean::__ANON__('register_type_constraint') called at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/namespace/autoclean.pm line 173 namespace::autoclean::__ANON__() called at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/B/Hooks/EndOfScope/XS.pm line 26 B::Hooks::EndOfScope::XS::__ANON__('HASH(0xa0267b0)', 'ARRAY(0xa770138)') called at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/MooseX/Types/Moose.pm line 73 eval {...} called at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/MooseX/Types/Moose.pm line 73 require MooseX/Types/Moose.pm called at -e line 0 main::BEGIN() called at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/MooseX/Types/Moose.pm line 73 eval {...} called at -e line 0 main::BEGIN() called at /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/MooseX/Types/Moose.pm line 0 eval {...} called at -e line 0 $ perl -MV=Moose,MooseX::Types,namespace::autoclean,namespace::clean,B::Hooks::EndOfScope Moose /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/i686-linux-thread-multi/Moose.pm: 2.0007 MooseX::Types /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/MooseX/Types.pm: 0.44 namespace::autoclean /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/namespace/autoclean.pm: 0.19 namespace::clean /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/namespace/clean.pm: 0.25 B::Hooks::EndOfScope /home/tai/.perlbrew/libs/perl-5.12.5@moose-2.0007/lib/perl5/B/Hooks/EndOfScope.pm: 0.13
The cause seems to be that namespace::autoclean calls the "does" method on MooseX::Types::Moose, but the "does" method is broken. "does" is broken because MooseX::Types::Moose is not a Moose-based class (so doesn't have a metaobject), but it inherits from MooseX::Types::Base, which is a Moose-based class. This could be fixed by namespace::autoclean wrapping its call to the "does" method in an eval block.
thanks, fixed in 0.020!