-
Notifications
You must be signed in to change notification settings - Fork 1.7k
implement @reopen
#50977
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
Comments
I don't understand the value of this annotation. The proposed lint ensures that the annotation is provided, but other than silencing the lint the annotation appears to have no impact on analysis. If the only value of the annotation is to silence a lint, and the only value of the lint is to require the annotation, then neither has any value. What am I missing? |
The way I understand it, Or maybe I'm missing what you're missing? 😉 |
What @pq says. The lint is to avoid reopening a closed class accidentally in a subclass. The It's a lint with false negatives, but still with (expected) enough value that it's worth dealing with those negatives. |
Ok, thanks to the analogy I think I understand. In the same way that not-awaiting a future is a foot gun, so is not sealing a subclass of a sealed class (etc. for the other conditions). Then the purpose of the lint isn't to require a |
SGTM. @munificent |
Exactly right. Though, personally, I'm not yet convinced that this lint should be recommended or core. We'll see how much of a footgun it actually is in practice. |
See: #50977 Change-Id: I8bc6547a3f5e2cf4bb8913b1d6dfb8a618fc2022 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278888 Reviewed-by: Kallen Tu <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
Implemented in c8df557 |
From the base-interface-final spec:
@reopen
lint...
A metadata annotation
@reopen
is added to package meta and a lint "require_reopen" is added to the linter. When the lint is enabled, a lint warning is reported if a class or mixin is not annotated@reopen
and it:See also: #58976
The text was updated successfully, but these errors were encountered: