Deprecated.subclass constructor

const Deprecated.subclass([
  1. String? message
])

Creates an annotation which deprecates subclassing (implementing or extending) a class.

The annotation can be used on class and mixin declarations which can currently be subclassed, so they are not marked final, or sealed, but where the ability to subclass will be removed in a later release.

Any existing class declaration which extends or implements the annotated class or mixin will cause a warning that such use is deprecated. Does not affect classes which mix in the annotated class (see Deprecated.extend, Deprecated.implement and Deprecated.mixin).

The annotation is not inherited by subclasses. If a public subclass will also become unsubclassable, which it will if the annotated declaration becomes final, but not if it becomes sealed, then the subclass should deprecate subclassability as well.

The message, if given, is displayed as part of the warning. The message should be aimed at the programmer who owns the subclassing class, and should recommend an alternative (if available), and say when this functionality is expected to be removed if that is sooner or later than the next major version.

Implementation

const Deprecated.subclass([this.message]) : _kind = _DeprecationKind.subclass;