Is there a deprecated annotation?

Is there a deprecated annotation that can be used in Motoko to mark function as such?

Hi,

Team motoko does it like this:

/// Append the values of two input arrays
/// @deprecated `Array.append` copies its arguments and has linear complexity; when used in a loop, consider using a `Buffer`, and `Buffer.append`, instead.
  public func append<A>(xs : [A], ys : [A]) : [A] {
   ....
  };

see Array.mo

Regards

1 Like

Sweet, will do the same. Thx!

It works out like a charm for a func, the deprecation will print a warning when I compile.

e.g.

Building canisters…
WARN: /Users/d…a/data.mo:62.5-62.22: warning [M0154], field putNoChecks is deprecated:
The new put function checks the timestamp to avoid data to be overwritten

But, for the record, same deprecated annotation applied to a public function of an actor seems to print no warning.