# New Ticket Created by Sir Robert Burbridge
# Please include the string: [perl #115286]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=115286 >
Methods and subs handle argument expansion differently (and unexpectedly
so):
multi sub foo (:$A) { say "A" };
multi sub foo (:$B) { say "B" };
my $str = 'B';
foo |($str => True); # output: B
The version below, however, says 'A' instead of 'B'.
class M {
multi method foo (:$A) { say "A" };
multi method foo (:$B) { say "B" };
}
my $str = 'B';
M.new.foo: |($str => True); # output: A