¢ > On 21 Oct 2015, at 11:50, Lloyd Fournier (via RT) > <perl6-bugs-follo...@perl.org> wrote: > > # New Ticket Created by Lloyd Fournier > # Please include the string: [perl #126417] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=126417 > > > > The design docs don't specifically say it's meant to work but implies it by > saying that shared traits can be set in the proto and default value ~~ > trait (to me). > > class A { > proto method foo($x = 'foo') {*} > multi method foo($x) { > $x.say; > } > } > > A.foo(); #!> none of these signatures match
Looks like the { * } is overriding anything you’re specified in the signature. Putting anything else in there, does seem to do the right thing. But there is no easy way to dispatch to the other candidate (that I know of). > If specifying a default in a proto is wrong it should carp I guess. Perl 6 doesn’t carp (afaik): but yeah, it should fail :-) Liz