In Routine§
See primary documentation in context for trait is DEPRECATED
multi trait_mod:<is>(Routine:D $r, :$DEPRECATED!)
Marks a Routine
as deprecated; that is, it should no longer be used going forward, and will eventually be removed. An optional message specifying the replacement functionality can be specified
By having both the original (deprecated) and new Routine
available simultaneously, you can avoid a breaking change in a single release, by allowing users time and instructions on how to update their code. Remove the deprecated version only after at least one release that includes both the warning and the new Routine
.
This code
sub f() is DEPRECATED('the literal 42') { 42 } say f();
produces this output:
42 Saw 1 occurrence of deprecated code. ================================================================================ Sub f (from GLOBAL) seen at: deprecated.raku, line 2 Please use the literal 42 instead. -------------------------------------------------------------------------------- Please contact the author to have these occurrences of deprecated code adapted, so that this message will disappear!