-
-
Save salortiz/0f869e25934d1457ff05ac2d0ba41e25 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
role Zub[::T] { | |
proto method CALL-ME(|c) { * } | |
multi method CALL-ME(Mu:D:) { | |
note "Got nothing"; | |
} | |
multi method CALL-ME(Mu:D: T $i) { | |
note "Got $i"; | |
} | |
} | |
class Foo { | |
has $!bar = Mu.new; | |
method bar(|c) is rw { | |
($!bar but Zub[Int])(|c); | |
} | |
} | |
Foo.new.bar(1); | |
Foo.new.bar(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment