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.
is default
1 parent 9e8e6fb commit e8d6d8dCopy full SHA for e8d6d8d
doc/Type/Attribute.pod6
@@ -30,6 +30,22 @@ The usual way to obtain an object of type C<Attribute> is by introspection:
30
$a.set_value($instance, [1, 2, 3]);
31
say $a.get_value($instance); # [1 2 3]
32
33
+=head1 Traits
34
+
35
+=head2 X<Trait is default|trait,is default (Attribute)>
36
37
+An attribute that is assinged L<Nil|/type/Nil> will revert to its default value
38
+set with the trait C<is default>.
39
40
+ class C {
41
+ has $.a is default(42) is rw = 666
42
+ }
43
+ my $c = C.new;
44
+ say $c;
45
+ $c.a = Nil;
46
47
+ # OUTPUT«C.new(a => 666)C.new(a => 42)»
48
49
=head1 Methods
50
51
=head2 method name
0 commit comments