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
Multis don't "does Callable" #997
Comments
From @pmichaud22:37 <pmichaud> rakudo: multi sub a() { 1; }; multi sub a($x) { $x; }; sub b(&x) { &x() }; b(&a); |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S06-multi/syntax.t commit 28f3f16da7fa11f0f22f39f3a5e0f6b4dfe9ee8a [t/spec] Tests for RT #65672, multi does Callable Inline Patchdiff --git a/t/spec/S06-multi/syntax.t b/t/spec/S06-multi/syntax.t
index f5efd83..141bec8 100644
--- a/t/spec/S06-multi/syntax.t
+++ b/t/spec/S06-multi/syntax.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 31;
+plan *;
# L<S06/Routine modifiers/>
# L<S06/Parameters and arguments/>
@@ -51,6 +51,8 @@ eval_dies_ok 'class B { multi method {} }', 'anonymous multi method is an error'
eval_dies_ok 'class C { proto method {} }', 'anonymous proto method is an error';
ok(&foo ~~ Multi, 'a multi does Multi');
+#?rakudo todo 'RT 65672'
+ok(&foo ~~ Callable, 'a multi does Callable');
is(~&foo, 'foo', 'a multi stringifies sensibly');
# note - example in ticket [perl #58948] a bit more elaborate
@@ -97,4 +99,15 @@ is(~&foo, 'foo', 'a multi stringifies sensibly');
is rt64922([1,2]), 2, 'optional parameter does not break type-based candidate sorting';
}
+# RT #65672
+{
+ multi rt65672() { 99 }
+ multi rt65672($x) { $x }
+ sub rt65672caller( &x ) { &x() }
+ #?rakudo skip 'RT 65672'
+ is rt65672caller( &rt65672 ), 99, 'multi can be passed as callable';
+}
+
+done_testing;
+
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzworks now, tests pass. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#65672 (status was 'resolved')
Searchable as RT65672$
The text was updated successfully, but these errors were encountered: