From 8a8f0480d05f6180f11b645c78d9ac63a5a3451c Mon Sep 17 00:00:00 2001 From: Aviral Goel Date: Fri, 12 Jul 2024 11:10:21 -0700 Subject: [PATCH] Mention methods and fix text --- docs/syntax-attribute-functions-deprecated.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/syntax-attribute-functions-deprecated.md b/docs/syntax-attribute-functions-deprecated.md index 59b465c..1111e1e 100644 --- a/docs/syntax-attribute-functions-deprecated.md +++ b/docs/syntax-attribute-functions-deprecated.md @@ -15,16 +15,16 @@ This RFC proposes the introduction of a `@deprecated` attribute to mark deprecat ## Design -The `@deprecated` attribute can take upto two named string parameters. The parameters affect the warning message issued by the linter. The `reason` parameter gives the reason for deprecation and the `use` parameter gives the name of the function that should be used in lieu of the deprecated function. The following table shows the warning message issued by the different styles of this attribute when used on a function named `foo`. +The `@deprecated` attribute can only be used on named functions and methods. It does not apply recursively to the functions defined within the lexical scope of the attributed function. It can take upto two named string parameters. The parameters affect the warning message issued by the linter. The `reason` parameter gives the reason for deprecation and the `use` parameter gives the name of the function that should be used in lieu of the deprecated function. The following table shows the warning message issued by the different styles of this attribute when used on a function named `foo`. | Style | Message | | ----------------------------------------------- | -----------------------------------------------------------------------| | `@deprecated` | `"Function 'foo' is deprecated."` | | `@[deprecated {reason = string}]` | `"Function 'foo' is deprecated. "` | -| `@[deprecated {use = string}]` | `"Function 'foo' is deprecated. Use '' instead."` | -| `@[deprecated {reason = string, use = string}]` | `"Function 'foo' is deprecated. Use '' instead. ` | +| `@[deprecated {use = string}]` | `"Function 'foo' is deprecated, use '' instead."` | +| `@[deprecated {reason = string, use = string}]` | `"Function 'foo' is deprecated, use '' instead. ` | -The `@deprecated` attribute can only be used on named functions and methods. It does not apply recursively to the functions defined within the lexical scope of the attributed function. +If `foo` is a member of class `bar`, the warning messages above will start as `"Member 'bar.foo' is deprecated ...`. ## Related Work