Skip to content

Commit f35b982

Browse files
committed
RT #122332 test for sub as infix op between []
1 parent a63adf3 commit f35b982

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

S13-overloading/metaoperators.t

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 10;
4+
plan 11;
55

66
#L<S06/Operator overloading>
77

@@ -33,7 +33,13 @@ is ~(('OMG','BBQ') <<wtf>> ('BBQ','OMG')), 'OMGWTFBBQ BBQWTFOMG', '<<...>> hyper
3333
# RT 121692
3434
{
3535
sub foo { $^a ~ $^b };
36-
is ([[&foo]] <a b c d e>), 'abcde', "can we use sub as an op between[]";
36+
is ([[&foo]] <a b c d e>), 'abcde', "can we use a sub as an reduce op between [[]]";
37+
}
38+
39+
# RT 122332
40+
{
41+
sub foo ($a, $b) { $a * $b };
42+
is (2 [&foo] 3 [&foo] 4), 24, "can we use a sub as an infix op between []";
3743
}
3844

3945
# vim: ft=perl6

0 commit comments

Comments
 (0)