Skip to content

Commit

Permalink
Test M::foo if True calls M::foo
Browse files Browse the repository at this point in the history
Covers the bug from rakudo/rakudo#3034.
  • Loading branch information
jnthn committed Feb 5, 2020
1 parent 376d49f commit 7f4b636
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S04-statement-modifiers/if.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 15;
plan 16;

# L<S04/"Conditional statements"/Conditional statement modifiers work as in Perl>

Expand Down Expand Up @@ -98,4 +98,14 @@ plan 15;
is $res, 2, 'Correct handling of $_ in block to left of statement modifer if';
}

# https://github.com/rakudo/rakudo/issues/3034
{
my $called = False;
my module M {
our sub foo() { $called = True; }
}
M::foo if True;
ok $called, 'List-op call to sub in a package in `if` statement modifier works';
}

# vim: ft=perl6

0 comments on commit 7f4b636

Please sign in to comment.