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
The type binder breaks together for anonymous parameters (and parameters with the same name) with different constraints in Rakudo #1363
Comments
From @masak<masak> hooray for runnable, concrete examples! |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S06-multi/type-based.t commit fff5be9d99e2e6824395bb2183062e57c746336c [t/spec] tests for RT #69798 Inline Patchdiff --git a/t/spec/S06-multi/type-based.t b/t/spec/S06-multi/type-based.t
index 0027d4d..251a90c 100644
--- a/t/spec/S06-multi/type-based.t
+++ b/t/spec/S06-multi/type-based.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 45;
+plan *;
# type based dispatching
#
@@ -83,8 +83,22 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
is wins(Scissor.new, Paper.new), 1, 'Basic sanity 2';
is wins(Paper.new, Paper.new), 0, 'multi dispatch with faked generics';
is wins(Paper.new, Scissor.new), -1, 'fallback if there is a faked generic';
+
+ # now try again with anonymous parameters (see RT #69798)
+ multi wins_anon(Scissor $, Paper $) { 1 }
+ multi wins_anon(Paper $, Stone $) { 1 }
+ multi wins_anon(Stone $, Scissor $) { 1 }
+ multi wins_anon(::T $, T $) { 0 }
+ multi wins_anon( $, $) { -1 }
+
+ #?rakudo 3 skip 'RT 69798'
+ is wins_anon(Scissor, Paper), 1, 'MMD with anonymous parameters (1)';
+ is wins_anon(Paper, Paper), 0, 'MMD with anonymous parameters (2)';
+ is wins_anon(Stone, Paper), -1, 'MMD with anonymous parameters (3)';
+
}
+
{
multi m($x,$y where { $x==$y }) { 0 };
multi m($x,$y) { 1 };
@@ -164,4 +178,6 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
is y(1, 2.5), 2, 'generics in multis (-)';
}
+done_testing;
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzFixed with the new signature binder, tests unfudged |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#69798 (status was 'resolved')
Searchable as RT69798$
The text was updated successfully, but these errors were encountered: