Skip Menu |
Report information
Id: 127025
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: bri [at] abrij.org
Cc:
AdminCc:

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



Subject: Multimethods from a role fail to probe all where clauses during dispatch
Download (untitled) / with headers
text/plain 1.2k
Regression: (09:51:30 PM) camelia: rakudo-moar e360bd: OUTPUT«1␤» (09:51:57 PM) skids: m: role A { multi method a ($ where { $_.say; $_ ~~ /a/ } ) { "A".say }; multi method a ($ where { $_.say; $_ ~~ /b/ } ) { "B".say } }; class C does A { }; C.new.a("a"); (09:51:57 PM) camelia: rakudo-moar e360bd: OUTPUT«a␤a␤A␤» (09:52:02 PM) skids: m: role A { multi method a ($ where { $_.say; $_ ~~ /a/ } ) { "A".say }; multi method a ($ where { $_.say; $_ ~~ /b/ } ) { "B".say } }; class C does A { }; C.new.a("b"); (09:52:02 PM) camelia: rakudo-moar e360bd: OUTPUT«b␤Cannot call a(C.new: "b"); none of these signatures match:␤ (C $: $ where { ... }, *%_)␤ in block <unit> at /tmp/10zZDctR_z line 1␤␤» (09:52:08 PM) skids: star: role A { multi method a ($ where { $_.say; $_ ~~ /a/ } ) { "A".say }; multi method a ($ where { $_.say; $_ ~~ /b/ } ) { "B".say } }; class C does A { }; C.new.a("b"); (09:52:09 PM) camelia: star-m 2015.09: OUTPUT«b␤b␤b␤B␤» Classes seem to be OK: (09:55:47 PM) skids: m: class C { multi method a ($ where { $_.say; $_ ~~ /a/ } ) { "A".say }; multi method a ($ where { $_.say; $_ ~~ /b/ } ) { "B".say } }; C.new.a("a"); C.new.a("b"); (09:55:47 PM) camelia: rakudo-moar e360bd: OUTPUT«a␤a␤A␤b␤b␤b␤B␤»
Download (untitled) / with headers
text/plain 347b
PR #672 fixed the original issue, but while writing tests I noticed the order of candidate testing is wrong, which is significant because the first candidate to match should be chosen. Fudged tests that cover both issues were added to S06-multi/value-based.t; look for this ticket number. So I'll leave this ticket open for that related issue.


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