@Deprecated

Identifies a declared element as deprecated.

Syntax

@Deprecated [ message ]

Parts

message
Optional string literal shown as part of the compiler warning.

Instructions

If you made a library that other programmers can use, you could make the decision that a declared element (a method, for example) will not be necessary. You can remove it, but that can cause errors for your users. An alternative is to deprecate that element, then remove it in a subsequent version.

With most other programming languages it is not easy to deprecate features of a library. A user must know to look in comments in the code, the change log, or in documentation. ViviFire lets you identify deprecated elements in your code.

If you try to use a deprecated element, the result is a compiler warning that you cannot easily ignore. If you also supply a message after the modifier, it will show immediately after the standard warning. This lets you give more information, for example, an alternative to the deprecated element.

Applies to

Examples

Library MyAPI

@Deprecated Class Foo
    ' ...
End Class

@Deprecated "Use Baz as an alternative"
Method Bar
    ' ...
End Method

Method Baz
    ' ...
End Method

See also