reopen top-level constant

Object const reopen

Annotation on declaration with less access restrictions than superinterface.

Indicates that the annotated class, mixin, or mixin class declaration intentionally allows subtypes outside the library to implement it, or extend it, or mix it in, even though it has some superinterfaces whose restrictions prevent inheritance. Such a subtype would otherwise cause lint warnings from the implicit_reopen lint.

A class, mixin, or mixin class declaration prevents inheritance if:

  • it is marked interface or final
  • it is marked sealed, and is implicitly interface or final based on the modifiers of its superinterfaces
  • it is an anonymous mixin application, and is implicitly interface or final based on the modifiers of its superinterfaces

A declaration annotated with @reopen will suppress warnings from the implicit_reopen lint. That lint will otherwise warn when a subtype has restrictions that are not sufficient to enforce the restrictions declared by class modifiers on one or more superinterfaces.

In addition, tools, such as the analyzer, can provide feedback if

  • The annotation is applied to anything other than a class, mixin, or mixin class.
  • The annotation is applied to a class or mixin which does not require it. (The intent to reopen was not satisfied.)

Implementation

const Object reopen = _Reopen();