Am 04.02.2011 05:04, schrieb Solomon Foster (via RT):
# New Ticket Created by Solomon Foster
# Please include the string: [perl #83356]
# in the subject line of all future correspondence about this issue.
#<URL: http://rt.perl.org/rt3/Ticket/Display.html?id=83356>
If I have this:
class A {
multi sub infix:<+>(A $a, A $b) is export { say "hello" }
}
my A $a .= new;
say ($a + $a).perl;
I get
Can't take numeric value for object of type A
in 'Any::Numeric' at line 1456:CORE.setting
in 'infix:<+>' at line 7454:CORE.setting
in main program body at line 8:frip.pl
That's correct behaviour. Multis are lexical by default (just like
ordinary only-subs), so the availability of the new infix:<+> outside
the class would be a bug.
Cheers,
Moritz