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 4aaa191 commit d6b162bCopy full SHA for d6b162b
doc/Type/Attribute.pod6
@@ -62,6 +62,15 @@ error.
62
CATCH{ default { say .^name, ': ', .Str } }
63
# OUTPUT: «X::Attribute::Required: The attribute '$!a' is required, but you did not provide a value for it.»
64
65
+You can also specify a reason why the attribute is required:
66
+
67
+ class D {
68
+ has $.a is required("it is a good idea");
69
+ }
70
+ my $d = D.new;
71
+ CATCH{ default { say .^name, ': ', .Str } }
72
+ # OUTPUT: «X::Attribute::Required: The attribute '$!a' is required because it is a good idea,but you did not provide a value for it.»
73
74
=head2 X<trait is DEPRECATED|trait,is DEPRECATED (Attribute)>
75
76
multi sub trait_mod:<is>(Attribute:D $r, :$DEPRECATED!)
0 commit comments