}
};
my %methods = %{Role::Tiny->_concrete_methods_of($name)};
+ # needed to ensure the method body is stable and get things named
+ Sub::Defer::undefer_sub($_) for grep defined, values %methods;
my @attrs;
{
# This local is completely not required for roles but harmless
my $attr = perlstring($name);
my $tc = Moose::Meta::TypeConstraint->new(
constraint => sub { die "This is not going to work" },
- inlined => sub { 'my $res = $_[42]{'.$attr.'}; $_[42]{'.$attr.'} = 1; $res' },
- #coercion => Moose::Meta::TypeCoercion->new(
- # type_coercion_map => [
- # 'Item', $coerce
- # ]
- #)
+ inlined => sub {
+ 'my $r = $_[42]{'.$attr.'}; $_[42]{'.$attr.'} = 1; $r'
+ },
);
$tc->coercion(Moose::Meta::TypeCoercion->new)
->_compiled_type_coercion($coerce);