On Mon Sep 20 06:51:49 2010, moritz wrote:
> 15:49 < jnthn> It may not be a bug.
> 15:49 < jnthn> rakudo: multi f ($ (Int :$value!)) { say "Int $value" };
> multi
>                f( $ (Str :$value!)) { say "Str $value" }; f('a' => 3);
> f('a' =>
>                'foo')
> 15:49 <+p6eval> rakudo 523da4: OUTPUT«No applicable candidates found to
>                 dispatch to for 'f'. Available candidates are:␤:(Any  (Int
>                 :value($value)!))␤:(Any  (Str :value($value)!))␤␤  in main
>                 program body at line 22:/tmp/DBB23kVew9␤»
> 15:50 < jnthn> OK, that looks more like one...
> 15:50 < jnthn> Thing is that it *can* match both signatures maybe if the
>                parameter is optional
> 15:50 < jnthn> OTOH it should still fail the type check
> 15:50 < jnthn> So, hm
> 15:50  * moritz_ adds that to the ticket
> 15:50 < jnthn> rakudo: ('a' => 3).Capture.perl
> 15:50 <+p6eval> rakudo 523da4:  ( no output )
> 15:50 < jnthn> rakudo: ('a' => 3).Capture.perl.say
> 15:50 <+p6eval> rakudo 523da4: OUTPUT«\()␤»
> 15:50 < jnthn> Oh.
> 15:51 < jnthn> rakudo: (1/2).Capture.perl.say
> 15:51 <+p6eval> rakudo 523da4: OUTPUT«\("numerator" => 1, "denominator"
> => 2)␤»
> 15:51 < jnthn> OK, pair capture coercion is FAIL

Recent IRC chat led to:

10:33 < jnthn> nom: multi f ((Int :$value, *%)) { say "Int $value" }; multi
               f((Str :$value, *%)) { say "Str $value" }; f('a' => 3); f('a' =>
               'foo')
10:33 <+p6eval> nom e17c13: OUTPUT«Int 3␤Str foo␤»
10:33 < jnthn> [Coke]: The code in the ticket would need to be the above to
               work; note the extra *%
10:34 < [Coke]> jnthn: so, given that, we can reject the ticket? ;)
10:35 < jnthn> [Coke]: I'd consider it fixed
10:35 < [Coke]> jnthn: needs test, you think?
10:35 < jnthn> [Coke]: It gave the wrong error before, now it gives the right
               one
10:36 < jnthn> [Coke]: I can blieve we need a test for the correct version of
               it.

So, Closable with tests.

-- 
Will "Coke" Coleda

Reply via email to