Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test for self not enforcing item context.
  • Loading branch information
jnthn committed Jan 12, 2015
1 parent c8e2a0c commit 0ffea18
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S12-methods/instance.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 38;
plan 39;

=begin pod
Expand Down Expand Up @@ -231,4 +231,13 @@ is AnonInvocant.new().me, AnonInvocant, 'a typed $: as invocant is OK';
is $tracker.name, 'foo', '... and that method knows its name';
}

{
my $i = 0;
my class A is Array {
method m() { $i++ for self }
}
A.new(1, 2, 3).m;
is $i, 3, 'self does not enforce an item context';
}

# vim: ft=perl6

0 comments on commit 0ffea18

Please sign in to comment.