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

Multis don't "does Callable" #997

Closed
p6rt opened this issue May 14, 2009 · 5 comments
Closed

Multis don't "does Callable" #997

p6rt opened this issue May 14, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 14, 2009

Migrated from rt.perl.org#65672 (status was 'resolved')

Searchable as RT65672$

@p6rt
Copy link
Author

p6rt commented May 14, 2009

From @pmichaud

22​:37 <pmichaud> rakudo​: multi sub a() { 1; }; multi sub a($x) { $x; }; sub b(&x) { &x() }; b(&a);
22​:38 <jnthn> :-( That's a ticket.
22​:38 <p6eval> rakudo f7dbcc​: OUTPUT«Parameter type check failed; expected something matching but got something of type Multi() for x in call to b␤current instr.​: 'die' pc
  16712 (src/builtins/control.pir​:225)␤»
22​:38 <jnthn> And that's the upshot of the first problem.
22​:38 <jnthn> pmichaud​: If you file, I can fix that tomorrow.
22​:38 * pmichaud files ticket.

@p6rt
Copy link
Author

p6rt commented Oct 26, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S06-multi/syntax.t

commit 28f3f16da7fa11f0f22f39f3a5e0f6b4dfe9ee8a
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Mon Oct 26 21​:48​:28 2009 +0000

  [t/spec] Tests for RT #​65672, multi does Callable
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28909 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --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

@p6rt
Copy link
Author

p6rt commented Oct 26, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

From @moritz

works now, tests pass.

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Mar 9, 2010
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant