Skip to content

Commit

Permalink
Test for RT #112666.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Dec 15, 2015
1 parent b111614 commit d1a2af4
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion S14-traits/routines.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 15;
plan 16;

# L<S14/Traits/>
{
Expand Down Expand Up @@ -93,4 +93,24 @@ plan 15;
'Applying traits to submethods retains submethod semantics';
}

# RT #112666
# Note: it's important this test stays in its nested block, not in the test
# mainline, as there was a bug that was hidden in the case it was in the
# mainline.
{
my role R {
has @.s is rw
}
multi trait_mod:<is>(Routine $r, :$x!) {
$r does R;
sub h(|){ for $r.s { &^m() } }
$r.wrap(&h)
};
sub b is x {};
my $called = False;
push &b.s, { $called = True };
b;
ok $called, 'interaction of mixin to routine with array attribute and wrap is correct';
}

# vim: ft=perl6

0 comments on commit d1a2af4

Please sign in to comment.