Skip Menu |
Report information
Id: 103112
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)



Subject: Presence of an Mu:U: multi method candidate busts autothreading for all the other candidates
Date: Mon, 07 Nov 2011 19:14:27 +0100
To: rakudobug [...] perl.org
From: Moritz Lenz <moritz [...] faui2k3.org>
Download (untitled) / with headers
text/plain 688b
use MONKEY_TYPING; augment class Mu { method FOO(Mu:U:) { say 'Mu.FOO'; } } augment class Str { method FOO(Str:D:) { say 'Str.FOO'; } } ('a' & 'b').FOO(); Output: Parameter '' requires a type object, but an object instance was passed in method FOO at dispatch.pl:3 in block <anon> at dispatch.pl:14 in <anon> at dispatch.pl:1 I'd argue that since the FOO method in class Mu fails to type-check against the argument list, the other candidate should be considered for autothreading. I believe (though I can't prove it) that this is the real problem behind https://rt.perl.org/rt3/Ticket/Display.html?id=103106 (regex-matching on a junction fails)
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 682b
At least nowadays this seems to happen only when augmenting class Mu. (I modified the original code a little by adding 'multi' keywords, but I think it still shows the same problem.) $ perl6 -e 'use MONKEY-TYPING; augment class Mu { multi method FOO(Mu:U:) { say "Mu.FOO" } }; augment class Str { multi method FOO(Str:D:) { say "Str.FOO" } }; ("a" & "b").FOO; Str.FOO' Cannot call FOO(Str: ); none of these signatures match: (Mu:U $: *%_) in block <unit> at -e:1 $ perl6 -e 'use MONKEY-TYPING; augment class Any { multi method FOO(Mu:U:) { say "Mu.FOO" } }; augment class Str { multi method FOO(Str:D:) { say "Str.FOO" } }; ("a" & "b").FOO; Str.FOO' Str.FOO Str.FOO Mu.FOO


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