We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3624102 commit f96ce35Copy full SHA for f96ce35
doc/Language/typesystem.pod6
@@ -182,6 +182,23 @@ TODO
182
183
=head3 trait C<trusts>
184
185
+To allow one class to access the private methods of another class use the trait
186
+C<trusts>. A forward declaration of the tuested class may be required.
187
+
188
+ class B {...};
189
+ class A {
190
+ trusts B;
191
+ has $!foo;
192
+ method !foo { return-rw $!foo }
193
+ method perl { "A.new(foo => $!foo)" }
194
+ };
195
+ class B {
196
+ has A $.a .= new;
197
+ method change { $!a!A::foo = 42; self }
198
199
+ say B.new.change;
200
+ OUTPUT«B.new(a => A.new(foo => 42))»
201
202
TODO
203
204
=head3 Versioning and Authership
0 commit comments