On Tue May 04 13:49:19 2010, masak wrote:
> <masak> the lack of an argument counts as narrower than a slurpy.
> <masak> but what about a single optional?
> <masak> rakudo: multi foo() { say "OH HAI" }; multi foo(Int $a?) {};
> multi foo(Str $a?) {}; foo
> <p6eval> rakudo 1eef08: OUTPUT«Ambiguous dispatch to multi 'foo'.
> Ambiguous candidates had signatures:␤:()␤:(Int $a?)␤:(Str $a?) [...]
> <masak> any reason one shouldn't count the lack of an argument as
> narrower there too?
> <masak> it would be a nice way to resolve the ensuing ambiguity
> between :(Int $a?) and :(Str $a?)
> <spinclad> masak: a definite nothing is narrower than a possible Int
> or Str, i agree
> * masak submits rakudobug
> <masak> might need a bit of spec too, maybe.

Implemented it, though it fell out rather more naturally as a tie-break rather 
than by further complicating the narrowness analysis. Tests in 
S06-multi/syntax.t.

/jnthn

Reply via email to