Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test for overriding invoke with postcircumfix:<( )>

  • Loading branch information...
commit 160bc8b7d09c8a5532cb80ea623a2df13e9d6c6b 1 parent fe0dfd6
@moritz moritz authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 S13-overloading/operators.t
View
17 S13-overloading/operators.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 3;
+plan 4;
#L<S06/Operator overloading>
@@ -30,4 +30,19 @@ plan 3;
is A.new<foo bar>, <foo bar>, 'defining postcircumfix:<{ }> works';
}
+# overloaded invoke
+# RT #76330
+# (even though the ticket title claims it, the actual problem was not related
+# to monkey typing/augmenting at all)
+
+{
+ class B {
+ has $.x;
+ method postcircumfix:<( )>($y) {
+ $.x ~ $y;
+ }
+ }
+ is B.new(x => 'a').('b'), 'ab', 'can overload invoke';
+}
+
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.