-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update the docs for @reopen
to finalized spec
#51551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
devexp-pkg-meta
Issues related to package:meta
legacy-area-analyzer
Use area-devexp instead.
P1
A high priority bug; for example, a single project is unusable or has many test failures
Comments
Some background for recent changes in dart-lang/language#2755. See also: dart-lang/language#2871 |
/fyi @eernstg in case you're up for taking a crack at some clarification here |
Here's one possible direction for the evolution of this text: Annotation for intentionally loosening restrictions on subtyping.
Indicates that the annotated class, mixin, or mixin class declaration
intentionally allows subtypes to implement it, or extend it, or mix it
in, even though it has some superinterfaces whose constraints are
thereby indirectly violated. For example, if the superinterface is
`interface`, and the annotated declaration is a plain subclass, we can
indirectly inherit methods from the superinterface, even though that's
an error if it is done directly.
A declaration annotated with `@reopen` will not generate warnings from the
`implicit_reopen` lint. That lint will otherwise warn when a subtype *C*
has restrictions that are not sufficient to enforce the restrictions
declared by class modifiers on one or more superinterfaces.
First, some terminology. A class, mixin, or mixin class declaration
_prevents inheritance_ if it is marked `interface` or `final`, or it is marked
`sealed`, and an `interface` or `final` modifier is implicitly present, based
on the modifiers of its superinterfaces, or it is an anonymous mixin
application, and it is again implicitly `interface` or `final`. Finally, we can
specify the warning:
We give a warning if a declaration extends or mixes in another declaration
which prevents inheritance, and the subtype is not marked `final`,
`interface` or `sealed`. Issues:
|
This is just fantastic. Thank you Erik! |
Fixed w/ 4c7e878 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
devexp-pkg-meta
Issues related to package:meta
legacy-area-analyzer
Use area-devexp instead.
P1
A high priority bug; for example, a single project is unusable or has many test failures
The spec has changed a bit since we drafted the initial docs for the
@reopen
annotation, making them no-longer valid.Here's what we currently have:
See also #58976
/fyi @kallentu @lrhn @munificent
The text was updated successfully, but these errors were encountered: