@@ -268,39 +268,33 @@ const _OptionalTypeArgs optionalTypeArgs = _OptionalTypeArgs();
268
268
// "referenced."
269
269
const _Protected protected = _Protected ();
270
270
271
- /// Annotation for intentionally loosening restrictions on subtyping.
272
- ///
273
- /// Indicates that the annotated class or mixin declaration
274
- /// intentionally allows subclasses to implement or extend it, even
275
- /// though it has a superclass which does not allow that.
276
- ///
277
- /// A declaration annotated with `@reopen` will not generate warnings from the
278
- /// `implicit_reopen` lint. That lint will otherwise warn when a subclass *C*
279
- /// removes some of the restrictions that a superclass has.
280
- ///
281
- /// * A class or mixin prevents inheritance if it's marked interface, or if it
282
- /// is marked sealed and it extends or mixes in another class which prevents
283
- /// inheritance.
284
- /// * We give a warning if a subclass extends or mixes in another class which
285
- /// prevents inheritance, and the subclass is marked base, or is not marked
286
- /// `final` , `interface` or `sealed` .
287
- /// * A class or mixin requires inheritance if it's marked `base` , or if it is
288
- /// marked `sealed` and it extends or mixes in another class or mixin which
289
- /// requires inheritance.
290
- /// * We give a warning if a subclass extends or mixes in another class which
291
- /// requires inheritance, and the subclass has no modifier or is marked
292
- /// `interface` .
293
- /// * A class or mixin prevents subclassing if it's marked `final` , or if it is
294
- /// marked `sealed` and it extends, mixes in, or implements the interface of
295
- /// another class or mixin which prevents subclassing.
296
- /// * We give a warning if a subclass or sub-mixin extends, mixes in, implements
297
- /// the interface of, or has as an on type a class or mixin which prevents
298
- /// subclassing, and the subclass or sub-mixin has no modifier or is marked
299
- /// `interface` or `base` .
271
+ // todo(pq): add a link to `implicit_reopen` once implemented.
272
+
273
+ /// Annotation for intentionally loosening restrictions on subtyping that would
274
+ /// otherwise cause lint warnings to be produced by the `implicit_reopen` lint.
275
+ ///
276
+ /// Indicates that the annotated class, mixin, or mixin class declaration
277
+ /// intentionally allows subtypes outside the library to implement it, or extend
278
+ /// it, or mix it in, even though it has some superinterfaces whose restrictions
279
+ /// prevent inheritance.
280
+ ///
281
+ /// A class, mixin, or mixin class declaration prevents inheritance if:
282
+ ///
283
+ /// * it is marked `interface` or `final`
284
+ /// * it is marked `sealed` , and is implicitly `interface` or `final`
285
+ /// based on the modifiers of its superinterfaces
286
+ /// * it is an anonymous mixin application, and is implicitly `interface` or
287
+ /// `final` based on the modifiers of its superinterfaces
288
+ ///
289
+ /// A declaration annotated with `@reopen` will suppress warnings from the
290
+ /// `implicit_reopen` lint. That lint will otherwise warn when a subtype has
291
+ /// restrictions that are not sufficient to enforce the restrictions declared
292
+ /// by class modifiers on one or more superinterfaces.
300
293
///
301
294
/// In addition, tools, such as the analyzer, can provide feedback if
302
295
///
303
- /// * The annotation is applied to anything other than a class or mixin.
296
+ /// * The annotation is applied to anything other than a class, mixin, or mixin
297
+ /// class.
304
298
/// * The annotation is applied to a class or mixin which does not require it.
305
299
/// (The intent to reopen was not satisfied.)
306
300
@experimental // todo(pq): remove before publishing for 3.0 (https://github.com/dart-lang/sdk/issues/51059)
0 commit comments