You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fine. Track hasNonFinalField in manifests and requirements.
Persist and track `hasNonFinalField` for interface-like elements so
fine- grained dependencies can invalidate precisely when a class (or its
supertypes) declares a non-final instance field.
What’s changed
- Store `hasNonFinalField` on manifest items for classes, enums,
extension types, and mixins. The flag is serialized/deserialized and
printed in dumps.
- Add a tracked getter on `InterfaceElementImpl` that records a
dependency when `hasNonFinalField` is queried; use a private backing
field with a setter.
- Extend requirements schema with an optional `hasNonFinalField` entry
and record it when requested.
- Validate the requirement via a new
`InterfaceHasNonFinalFieldMismatch` failure.
- Exclude `hasNonFinalField` from item identity matching; it is enforced
via requirements instead of forcing new IDs.
- Bump `AnalysisDriver.DATA_VERSION` to 541 for the format change.
Why
- Consumers that depend on mutability of instance fields (directly or
through inheritance) now get targeted invalidation without unnecessary
ID churn, improving both correctness and incremental performance.
Implementation notes
- LibraryManifestBuilder copies `element.hasNonFinalField` into item
instances.
- Manifest read/write gains a boolean field on `InterfaceItem` (and
subclasses) and helpers to encode/decode optional booleans in the
requirements stream.
- Result printer includes `hasNonFinalField` in interface requirement
dumps.
Change-Id: Ib132dca582f77df87f995920dd9b73784a4eeefd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448444
Reviewed-by: Johnni Winther <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
0 commit comments