-
-
Save 0racle/72639a88f53b247ac20f8b1a580a46f0 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
use v6.d; | |
class A { | |
has $!a = 'private'; | |
method !a { $!a } | |
} | |
multi sub trait_mod:<is>(Mu:U \obj, :$spying!) { | |
A.^add_trustee(obj); | |
A.^compose; | |
} | |
class B is spying(A) { | |
has A $.a = A.new; | |
method m { say $!a!A::a } | |
} | |
B.new.m; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment