-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[proposal] add an @unstableGetter
annotation
#53632
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
Here's a sample of an existing annotation that informs a lint. (@eernstg: it should look familiar as IIRC you helped write it!)
|
I guess my concern is not necessarily future conflicts but being accidentally used instead of Also currently, I believe it would render on |
/// Annotation for a final instance variable indicating that the implicitly
/// induced getter of that variable is not intended to be stable.
///
/// This annotation is associated with the lint `avoid_unstable_final_fields`,
/// and it has no effect unless that lint is enabled.
///
/// When a final instance variable does not have this annotation, it is assumed
/// to induce a stable getter, and the lint will flag the overriding
/// declarations that cause this getter to be unstable (that is, the overriding
/// getters which may return different results on different invocations with
/// the same receiver).
///
/// When a final instance variable has this annotation, it is not assumed to
/// induce a stable getter, and overriding getters are not flagged, whether or
/// not they are stable.
///
/// Intuitively, this combination of lint and annotation is intended to have the
/// following effect: By default, every final instance variable is an immutable
/// property of the receiver. If a property is declared as a final instance
/// variable, but it is not intended to be immutable then it should have this
/// annotation. The lint will flag locations where this assumption is violated.
///
/// In addition, tools such as the analyzer can provide feedback if the
/// annotation is applied to anything other than a final instance variable. |
I'm ok with that. |
Me too. |
@unstable
annotation@unstableGetter
annotation
More context in #59313.
@eernstg: word-smithing welcome!
The text was updated successfully, but these errors were encountered: