File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,40 @@ say double 21; # 42
162
162
From inside another file you'd say C < use Foo; > to load a module and import the
163
163
exported functions.
164
164
165
+ = head2 trait is DEPRECATED
166
+
167
+ multi sub trait_mod:<is>(Routine:D $r, :$DEPRECATED!)
168
+
169
+ Marks a routine as deprecated, optionally with a message what to use instead.
170
+
171
+ This code
172
+
173
+ = begin code
174
+ sub f() is DEPRECATED('the literal 42') { 42 }
175
+ say f();
176
+ = end code
177
+
178
+ produces this output:
179
+
180
+ = begin code
181
+ 42
182
+ Saw 1 call to deprecated code during execution.
183
+ ================================================================================
184
+ Sub f (from GLOBAL) called at:
185
+ deprecated.p6, line 2
186
+ Please use the literal 42 instead.
187
+ --------------------------------------------------------------------------------
188
+ Please contact the author to have these calls to deprecated code adapted,
189
+ so that this message will disappear!
190
+
191
+ Please note that *ALL* deprecated features will be removed at the release
192
+ of Perl 6.0.0 (expected sometime in 2015).
193
+ = end code
165
194
166
195
= begin comment
167
196
168
197
TODO: explain export tags
169
- TODO: traits hidden_from_backtrace, DEPRECATED
198
+ TODO: traits hidden_from_backtrace
170
199
171
200
= end comment
172
201
You can’t perform that action at this time.
0 commit comments