Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multimethods from a role fail to probe all where clauses during dispatch #4928

Open
p6rt opened this issue Dec 25, 2015 · 3 comments
Open

Multimethods from a role fail to probe all where clauses during dispatch #4928

p6rt opened this issue Dec 25, 2015 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Dec 25, 2015

Migrated from rt.perl.org#127025 (status was 'new')

Searchable as RT127025$

@p6rt
Copy link
Author

p6rt commented Dec 25, 2015

From @skids

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␤»

@p6rt
Copy link
Author

p6rt commented Jan 5, 2016

From @skids

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.

@usev6
Copy link

usev6 commented Oct 14, 2023

For the record: The mentioned tests have been moved to APPENDICES/A01-limits/misc.t with Raku/roast@4ae2c6a940 (and they still live there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants