Created
April 14, 2016 19:18
-
-
Save jonathanstowe/8642d30f2dab6527b5c4c65d4420aebb to your computer and use it in GitHub Desktop.
multi method role
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
role Zub[::T] { | |
proto method CALL-ME(|c) { * } | |
multi method CALL-ME(Mu:D $self) { | |
} | |
multi method CALL-ME(Mu:D $self, T $i) { | |
} | |
} | |
multi sub trait_mod:<is> (Method $m, :$foo!) is export { | |
$m does Zub[Int]; | |
} | |
class Foo { | |
proto method bar(|c) { * } | |
multi method bar() is foo { | |
} | |
multi method bar(Int $o) is foo { | |
} | |
} | |
Foo.new.bar(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment