Skip Menu |
Report information
Id: 124142
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: moritz <moritz.lenz+perl [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Moritz Lenz <moritz [...] faui2k3.org>
Date: Sun, 22 Mar 2015 13:17:33 +0100
To: rakudobug [...] perl.org
Subject: Something is off with multi dispatch, natives and where clauses
Download (untitled) / with headers
text/plain 559b
moritz@pat:~/p6/rakudo>cat ack.p6 proto a(int, int) {*}; multi a(int $ where 0, int \n) { n + 1 }; multi a(int \m, int $ where 0) { a m -1 , 1 }; multi a(int \m, int \n) { a m - 1, a m, n - 1 }; say a 3, 1 moritz@pat:~/p6/rakudo>./perl6-m ack.p6 Cannot call a(3, 1); none of these signatures match: (int $ where { ... }, int \n) (int \m, int $ where { ... }) (int \m, int \n) in block <unit> at ack.p6:7 When I replace every instance of 'int' with 'Int' in the test program, it works (no dispatch errors), and produces the output "13\n".
Still reproducible (2017.11, HEAD(5929887))

On 2015-03-22 05:17:48, moritz wrote:
Show quoted text
> moritz@pat:~/p6/rakudo>cat ack.p6
> proto a(int, int) {*};
> multi a(int $ where 0, int \n) { n + 1 };
> multi a(int \m, int $ where 0) { a m -1 , 1 };
> multi a(int \m, int \n) {
> a m - 1, a m, n - 1
> };
> say a 3, 1
>
> moritz@pat:~/p6/rakudo>./perl6-m ack.p6
> Cannot call a(3, 1); none of these signatures match:
> (int $ where { ... }, int \n)
> (int \m, int $ where { ... })
> (int \m, int \n)
> in block <unit> at ack.p6:7
>
>
> When I replace every instance of 'int' with 'Int' in the test program,
> it works (no dispatch errors), and produces the output "13\n".




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org