Skip to content

Commit 1fac507

Browse files
committed
A user-declared infix:<;> clashes with statement stopper ';' in Rakudo
1 parent 03e0f30 commit 1fac507

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

S06-operator-overloading/semicolon.t

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
use v6;
2+
use Test;
3+
plan 3;
4+
5+
# A user-declared infix:<;> clashes with statement stopper ';' in Rakudo
6+
7+
my $marker = 0;
8+
9+
sub infix:<;>($a, $b) {
10+
$marker = 1;
11+
0, 0
12+
};
13+
14+
my @a = 1; 2; 3;
15+
16+
17+
is +@a, 1, '@a is array with 1 element';
18+
is @a[0], 1, 'first element of @a eq 1';
19+
is $marker, 0, 'overloaded infix ; hasn\'t been called';
20+

0 commit comments

Comments
 (0)