8 q[&{}] => sub { shift->to_code },
16 eval "sub { $$self }";
23 use base 'Dark::Side';
26 return quote_sub $$self;
30 my $darkside = Dark::Side->new('my $dummy = "join the dark side"; $_[0] * 2');
31 is($darkside->(6), 12, 'check Dark::Side coderef');
33 my $theforce = The::Force->new('my $dummy = "use the force Luke"; $_[0] * 2');
34 is($theforce->(6), 12, 'check The::Force coderef');
39 has a => (is => "ro", coerce => $darkside, isa => sub { 1 });
40 has b => (is => "ro", coerce => $theforce, isa => The::Force->new('my $z = "I am your father"'));
43 my $o = Doubleena->new(a => 11, b => 12);
44 is($o->a, 22, 'non-Sub::Quoted inlined coercion overload works');
45 is($o->b, 24, 'Sub::Quoted inlined coercion overload works');
48 my $constructor = B::Deparse->new->coderef2text(Doubleena->can('new'));
50 like($constructor, qr{use the force Luke}, 'Sub::Quoted coercion got inlined');
51 unlike($constructor, qr{join the dark side}, 'non-Sub::Quoted coercion was not inlined');
52 like($constructor, qr{I am your father}, 'Sub::Quoted isa got inlined');