On Fri, Feb 4, 2011 at 7:29 AM, Moritz Lenz via RT <perl6-bugs-follo...@perl.org> wrote: > 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.
But "is export" means it is available outside the class anywhere this file is "use"d. Is it really intended that it is available outside the class everywhere except the file it is defined in? And if so, how should it be defined so that the multi is visible elsewhere in that file? -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com