@@ -14,31 +14,35 @@ package scala
14
14
15
15
import scala .annotation .meta ._
16
16
17
- /** An annotation that designates that the name of a parameter is deprecated.
18
- *
19
- * Using this name in a named argument generates a deprecation warning.
20
- *
21
- * Library authors should state the library's deprecation policy in their documentation to give
22
- * developers guidance on how long a deprecated name will be preserved.
23
- *
24
- * Library authors should prepend the name of their library to the version number to help
25
- * developers distinguish deprecations coming from different libraries:
26
- *
27
- * {{{
28
- * def inc(x: Int, @deprecatedName("y", "FooLib 12.0") n: Int): Int = x + n
29
- * inc(1, y = 2)
30
- * }}}
31
- * will produce the following warning:
32
- * {{{
33
- * warning: the parameter name y is deprecated (since FooLib 12.0): use n instead
34
- * inc(1, y = 2)
35
- * ^
36
- * }}}
37
- *
38
- * @see [[scala.deprecated ]]
39
- * @see [[scala.deprecatedInheritance ]]
40
- * @see [[scala.deprecatedOverriding ]]
41
- */
17
+ /** An annotation that designates that the name of a parameter is deprecated.
18
+ *
19
+ * Using this name in a named argument generates a deprecation warning.
20
+ *
21
+ * If the `name` is omitted, then using the canonical name is deprecated.
22
+ * In that case, lints such as `-Xlint:named-booleans` which encourage
23
+ * the use of a name will not warn.
24
+ *
25
+ * Library authors should state the library's deprecation policy in their documentation to give
26
+ * developers guidance on how long a deprecated name will be preserved.
27
+ *
28
+ * Library authors should prepend the name of their library to the version number to help
29
+ * developers distinguish deprecations coming from different libraries:
30
+ *
31
+ * {{{
32
+ * def inc(x: Int, @deprecatedName("y", "FooLib 12.0") n: Int): Int = x + n
33
+ * inc(1, y = 2)
34
+ * }}}
35
+ * will produce the following warning:
36
+ * {{{
37
+ * warning: the parameter name y is deprecated (since FooLib 12.0): use n instead
38
+ * inc(1, y = 2)
39
+ * ^
40
+ * }}}
41
+ *
42
+ * @see [[scala.deprecated ]]
43
+ * @see [[scala.deprecatedInheritance ]]
44
+ * @see [[scala.deprecatedOverriding ]]
45
+ */
42
46
@ param
43
47
@ deprecatedInheritance(" Scheduled for being final in the future" , " 2.13.0" )
44
48
class deprecatedName (name : String = " <none>" , since : String = " " ) extends scala.annotation.StaticAnnotation {
0 commit comments