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
MMD is dispatching too many times. #1286
Comments
From @TimbusIt seems when you add more than one role with the same multimethod name Expected output: Actual output: |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S12-methods/multi.t commit 652203cdd73b00a2296712186ad8888fa07b8fec [t/spec] Test for RT 69192 Inline Patchdiff --git a/t/spec/S12-methods/multi.t b/t/spec/S12-methods/multi.t
index 30c913c..1266708 100644
--- a/t/spec/S12-methods/multi.t
+++ b/t/spec/S12-methods/multi.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 16;
+plan 19;
# L<S12/"Multisubs and Multimethods">
# L<S12/"Multi dispatch">
@@ -113,4 +113,39 @@ is Bar.new.a("not an Int"), 'Any-method in Foo';
'call order is correct for class, role, parent'
}
+# RT 69192
+{
+ role R5 {
+ multi method rt69192() { push @.order, 'empty' }
+ multi method rt69192(Str $a) { push @.order, 'Str' }
+ }
+ role R6 {
+ multi method rt69192(Num $a) { push @.order, 'Num' }
+ }
+ class RT69192 { has @.order }
+
+ {
+ my RT69192 $bot .= new();
+ $bot does R5 does R6;
+ $bot.*rt69192;
+ #?rakudo todo 'RT #69192'
+ is $bot.order, <empty>, 'multi method called once on empty signature';
+ }
+
+ {
+ my RT69192 $bot .= new();
+ $bot does R5 does R6;
+ $bot.*rt69192('RT #69192');
+ #?rakudo todo 'RT #69192'
+ is $bot.order, <Str>, 'multi method called once on Str signature';
+ }
+
+ {
+ my RT69192 $bot .= new();
+ $bot does R5 does R6;
+ $bot.*rt69192( 69192 );
+ is $bot.order, <Num>, 'multi method called once on Num signature';
+ }
+}
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThe sample code now runs as expected, and the tests pass, so I'm calling |
@kyleha - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#69192 (status was 'resolved')
Searchable as RT69192$
The text was updated successfully, but these errors were encountered: