#1144: MMD incorrectly matches _ instead of String
-----------------------------+----------------------------------------------
Reporter: Austin_Hastings | Type: bug
Status: new | Priority: normal
Milestone: | Component: none
Version: 1.7.0 | Severity: medium
Keywords: | Lang:
Patch: | Platform:
-----------------------------+----------------------------------------------
In the code below, I believe that calls to `foo('bar')` should be
delivered to the :multi(String) sub, not the :multi(_) sub.
{{{
.namespace []
.sub 'foo' :multi(_)
.param pmc args :slurpy
print "multi(_) : arg is a: "
$P0 = shift args
$S0 = typeof $P0
say $S0
.end
.sub 'foo' :multi(String)
.param pmc args :slurpy
say "multi(String)"
.end
.sub 'main' :main
foo(1)
foo('bar')
foo('bar', 'baz')
$P0 = box 'bar'
foo($P0)
foo($P0, 'baz')
.end
}}}
On my 1.7.0-devel version, the output is:
{{{
multi(_) : arg is a: Integer
multi(_) : arg is a: String
multi(_) : arg is a: String
multi(String)
multi(String)
}}}
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1144>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets