Skip Menu |

This queue is for tickets about the Role-Hooks CPAN distribution.

Report information
The Basics
Id: 133595
Status: resolved
Priority: 0/
Queue: Role-Hooks

People
Owner: Nobody in particular
Requestors: DAKKAR [...] cpan.org
Cc:
AdminCc:

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



Subject: applying a role to a non-Moo* class, with Moose loaded, after Role::Hooks has installed its patches, dies
use Moose (); # needs to be loaded use Role::Hooks; { package MyRole; use Role::Tiny; Role::Hooks->before_apply(__PACKAGE__, sub { }); } { package OtherRole; use Role::Tiny; } { package MyClass; use Role::Tiny::With; with 'OtherRole'; # <--- this throws } The exception is: Can't call method "isa" on an undefined value at ..../Role/Hooks.pm line 51 This is because Moose::Util::find_meta() returns undef for non-Moose classes. I initially noticed this in an application that used a library using Role::Hooks. The application applied a Moo::Role to a Mojo::Base-based class, neither of which had anything to do with Role::Hooks. I think the smallest patch it to `use Safe::Isa` and use `->$_isa()` test in `is_role` (tested, it works)
Thanks; fixed in 0.002.