Skip to content

Commit e78ee04

Browse files
t-a-kkhwilliamson
authored andcommitted
perldelta.pod: describe the bug where "0+" methods were sometimes called in reverse order
The previous commit "pp.c, pp_hot.c: Reorder SvXV_nomg() to fetch operands in left-to-right order" will not only change the order of "Use of uninialized value" warnings, but actually also change the order of the call of "0+" overloading methods for each operands.
1 parent dbbbb38 commit e78ee04

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pod/perldelta.pod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,17 @@ manager will later use a regex to expand these into links.
376376

377377
XXX
378378

379+
=item *
380+
381+
When both operands of arithmetic operators (C<+>, C<->, etc.) are
382+
L<overload>ed objects which have no method for that operator but have
383+
a C<0+> method and the C<fallback> option set to TRUE,
384+
perl will normally call the C<0+> method for the left operand first
385+
and then call one for the right operand, i.e. in the same order
386+
with operand evaluation order.
387+
But if C<S<use integer;>> is in effect, the C<0+> methods used to be
388+
called in wrong (reverse) order.
389+
379390
=back
380391

381392
=head1 Known Problems

0 commit comments

Comments
 (0)