Created
July 4, 2013 19:51
-
-
Save arnsholt/5929886 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub foo() { say "in sub"; } | |
role Test { | |
method postcircumfix:<( )>($args) { | |
say "overridden"; | |
} | |
} | |
role Other { | |
method bar() { say "foo"; } | |
} | |
&foo does Test; | |
&foo does Other; | |
foo(); | |
# Prints "in sub", not "overridden" as expected. | |
class Foo { method foo() { say "in class"; } } | |
role TestFoo { method foo() { say "overridden"; } } | |
my Foo $x .= new; | |
$x does TestFoo; | |
$x does Other; | |
$x.foo; | |
# Prints "overridden" as expected. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment