Skip to content

Commit d7feaf8

Browse files
committed
add trap but R1,R2
1 parent b2aa298 commit d7feaf8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/Language/traps.pod6

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,15 @@ to a power, use parentheses:
355355
say (-1)²; # 1
356356
say (-1)**2; # 1
357357
358+
The operator infix:<but> is narrower then the list constructor. When providing
359+
a list of roles to mix in, always use parentheses.
360+
361+
role R1 { method m {} }
362+
role R2 { method n {} }
363+
my $a = 1 but R1,R2; # R2 is in sink context
364+
say $a.^name;
365+
# OUTPUT«Int+{R1}␤»
366+
358367
=head1 Subroutine and method calls
359368
360369
Subroutine and method calls can be made using one of two forms:

0 commit comments

Comments
 (0)