Skip to content

Commit 394fc0b

Browse files
committed
Routine: document is DEPRECATED
1 parent ca2186e commit 394fc0b

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

lib/Type/Routine.pod

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,40 @@ say double 21; # 42
162162
From inside another file you'd say C<use Foo;> to load a module and import the
163163
exported functions.
164164
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
165194
166195
=begin comment
167196
168197
TODO: explain export tags
169-
TODO: traits hidden_from_backtrace, DEPRECATED
198+
TODO: traits hidden_from_backtrace
170199
171200
=end comment
172201

0 commit comments

Comments
 (0)