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 f6df30a commit 20fb6ceCopy full SHA for 20fb6ce
doc/Type/Attribute.pod6
@@ -68,7 +68,20 @@ error.
68
69
Marks an attribute as deprecated, optionally with a message what to use instead.
70
71
-TODO: Add example when it's implemented in Rakudo.
+ class C {
72
+ has $.foo is DEPRECATED("'bar'");
73
+ }
74
+ my $c = C.new( foo => 42 ); # doesn't trigger with initialization (yet)
75
+ say $c.foo; # does trigger on usage
76
+
77
+B<After> the program is finished, this will show something like this on
78
+STDERR:
79
80
+ # Saw 1 occurrence of deprecated code.
81
+ # =====================================
82
+ # Method foo (from C) seen at:
83
+ # script.pl6, line 5
84
+ # Please use 'bar' instead.
85
86
=head1 Methods
87
0 commit comments