Skip to content

Instantly share code, notes, and snippets.

@arnsholt
Created July 4, 2013 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnsholt/5929886 to your computer and use it in GitHub Desktop.
Save arnsholt/5929886 to your computer and use it in GitHub Desktop.
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