On Fri Apr 16 01:31:22 2010, masak wrote:
> <masak> rakudo: multi foo(Int $x is rw) { say "writable" }; multi
> foo(Int $x) { "readonly" }; foo(42)
> <p6eval> rakudo 78faa0: OUTPUT«Ambiguous dispatch to multi 'foo'.
> Ambiguous candidates had signatures:␤:(Int $x)␤:(Int $x) [...]
> * masak submits rakudobug
> <masak> S06: "To allow modification, use the C<is rw> trait.  This
> requires a mutable object or container as an argument (or some kind of
> type object that can be converted to a mutable object, such as might
> be returned by an array or hash that knows how to autovivify new
> elements). Otherwise the signature fails to bind, and this candidate
> routine cannot be considered for servicing this particular call.
> (Other multi candidates, if any, may succeed if they don't require
> C<rw> for this parameter.)"
> <moritz_> now you're just showing off :-)
> <masak> :P

Behavior is mostly unchanged since 2010 - error message has better signature 
reporting, but still reported as ambiguous.

20:36 <[Coke]> m: multi foo(Int $x is rw) { say "writable" }; multi foo(Int $x)
               { "readonly" }; foo(42)
20:36 <camelia> rakudo-moar b2b333: OUTPUT«Ambiguous call to 'foo'; these
                signatures all match:␤:(Int $x is rw)␤:(Int $x)␤  in sub foo at
                /tmp/CwM3ZkL1nu:1␤  in block  at /tmp/CwM3ZkL1nu:1␤␤»
-- 
Will "Coke" Coleda

Reply via email to