Skip to content

Commit 4c7e878

Browse files
pqCommit Queue
authored and
Commit Queue
committed
update @reopendocs
Fixes: https://dart-review.googlesource.com/c/sdk/+/286860 Feedback welcome. I expect we'll want to iterate more on this but I see Erik's new content as a distinct improvement. Change-Id: Iba385be6c411f2e5e3f1bd490b437dbea86e07aa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286860 Reviewed-by: Erik Ernst <[email protected]> Reviewed-by: Marya Belanger <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
1 parent eadfede commit 4c7e878

File tree

3 files changed

+29
-31
lines changed

3 files changed

+29
-31
lines changed

pkg/meta/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.9.1-dev
2+
3+
* Update `@reopen` documentation.
4+
15
## 1.9.0
26

37
* Introduce `@reopen` to annotate class or mixin declarations that can safely

pkg/meta/lib/meta.dart

+24-30
Original file line numberDiff line numberDiff line change
@@ -268,39 +268,33 @@ const _OptionalTypeArgs optionalTypeArgs = _OptionalTypeArgs();
268268
// "referenced."
269269
const _Protected protected = _Protected();
270270

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.
300293
///
301294
/// In addition, tools, such as the analyzer, can provide feedback if
302295
///
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.
304298
/// * The annotation is applied to a class or mixin which does not require it.
305299
/// (The intent to reopen was not satisfied.)
306300
@experimental // todo(pq): remove before publishing for 3.0 (https://github.com/dart-lang/sdk/issues/51059)

pkg/meta/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: meta
22
# Note, because version `2.0.0` was mistakenly released, the next major version must be `3.x.y`.
3-
version: 1.9.0
3+
version: 1.9.1-dev
44
description: >-
55
Annotations used to express developer intentions that can't otherwise be
66
deduced by statically analyzing source code.

0 commit comments

Comments
 (0)