Skip to content

Commit

Permalink
test for overriding invoke with postcircumfix:<( )>
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jan 13, 2012
1 parent fe0dfd6 commit 160bc8b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion S13-overloading/operators.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 3;
plan 4;

#L<S06/Operator overloading>

Expand Down Expand Up @@ -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

0 comments on commit 160bc8b

Please sign in to comment.