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

overloading an operator hides other candidates #1669

Closed
p6rt opened this issue Apr 7, 2010 · 6 comments
Closed

overloading an operator hides other candidates #1669

p6rt opened this issue Apr 7, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 7, 2010

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

Searchable as RT74104$

@p6rt
Copy link
Author

p6rt commented Apr 7, 2010

From @moritz

10​:20 <@​moritz_> rakudo​: class A { }; multi sub infix​:<+>(A $, A $) { };
  say 3+3
10​:20 <+p6eval> rakudo 8c434e​: OUTPUT«No applicable candidates found to
dispatch to
  for 'infix​:<+>'. Available candidates are​:␤​:(A , A
)␤␤current instr.​:
  '_block14' pc 29 (EVAL_1​:0)␤»
10​:20 <@​moritz_> ouch
10​:21 <@​moritz_> it hides all the outer multis
10​:21 <@​moritz_> worth a bug report

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

[14​:44] <bbkr> star​: class A { }; multi sub infix​:<+>(A $, A $) { -1 };
say 3+3 # http://rt.perl.org/rt3/Ticket/Display.html?id=74104
[14​:44] <p6eval> star 2010.07​: OUTPUT«6␤»

taking for tests

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

tests added in t/spec/S06-operator-overloading/sub.t

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

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

@p6rt p6rt closed this as completed Aug 3, 2010
@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @kyleha

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

commit 0dfc369d60e934bfaa91de967f58e5d4d12198be
Author​: bbkr <bbkr@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Aug 3 12​:53​:29 2010 +0000

  [t/spec] tests for RT #​74104 overloading an operator hides other candidates
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31894 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S06-operator-overloading/sub.t b/t/spec/S06-operator-overloading/sub.t
index acb7524..57094f6 100644
--- a/t/spec/S06-operator-overloading/sub.t
+++ b/t/spec/S06-operator-overloading/sub.t
@@ -399,6 +399,14 @@ Testing operator overloading subroutines
     is $x, 6, 'bar= works for custom operators';
 
 }
+
+# RT #74104
+{
+    class RT74104 {}
+    multi sub infix:<+>(RT74104 $, RT74104 $) { -1 }
+    is 2+2, 4, 'overloading an operator does not hide other candidates';
+}
+
 done_testing;
 
 # vim: ft=perl6

@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