Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT #73990, "1 but last"
  • Loading branch information
moritz committed Aug 7, 2012
1 parent 59ded64 commit a0df9db
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion S14-roles/mixin.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 30;
plan 32;

# L<S14/Run-time Mixins/>

Expand Down Expand Up @@ -138,4 +138,19 @@ is (class { } but role { method answer() { 42 } }).answer, 42,
# RT #101022
lives_ok {(True but role {}).gist}, 'can mix into True';

# RT #73990
{
my $tracker = '';
for 1..3 {
$tracker ~= 'before';
1 but last;
$tracker ~= 'after';
}
is $tracker, 'before', '"1 but last" does the same as "last"';

sub f() { role { method answer { 42 } } };
is (1 but f).answer, 42, '<literal> but <zero-arg call> works';

}

# vim: syn=perl6

0 comments on commit a0df9db

Please sign in to comment.