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
Elements. Compute and serialize hasNonFinalField for interfaces.
Compute `InterfaceElementImpl.hasNonFinalField` once during linking and
persist it in summaries for classes and mixins. This replaces the
previous on-demand, tracked getter with a stored boolean initialized via
a recursive walk over the superclass and mixin chain.
Key changes:
- Add `bool hasNonFinalField` to `InterfaceElementImpl`.
- Compute the value in `link.dart::_computeHasNonFinalField()` after
`_resolveTypes()` and before `_setDefaultSupertypes()`, memoizing to
avoid recomputation.
- Serialize/deserialize the value in bundle writer/reader for class and
mixin elements.
- Remove the expensive getter and its requirement recording.
- Bump `DATA_VERSION` to 525.
Why:
- Avoid repeatedly traversing hierarchies at query time.
- Make the property available across library boundaries via summaries.
- Reduce analysis overhead for checks that depend on field mutability
(e.g., const constructor eligibility).
Impact:
- No intended behavioral change; the result matches the prior logic:
true if any instance, non-const, non-static, non-synthetic field is
declared in the class, its supertypes, or applied mixins.
- Older summaries are invalidated by the version bump.
Change-Id: I2db038341d5a1d9c2d039bc73db9b6bd1e566056
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446002
Reviewed-by: Johnni Winther <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
0 commit comments