Skip to content

Commit 5ce6cd9

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Record isSynthetic in manifest items.
Capture whether an element is synthetic in the manifest and make it part of equality/matching so changes between implicit and explicit declarations are treated as API-relevant. Previously the manifest did not distinguish synthetic from declared members (e.g., default constructors, field-generated accessors, and variable-generated top-level accessors). Flipping between synthetic and explicit could reuse stale IDs and interfaces, leading to incorrect link reuse and dependency tracking. It might be surprising, but we actually do use `isSynthetic` during resolution, e.g. to decide whether look at metadata of a getter, or the field. This change: - Adds an `isSynthetic` flag to `ManifestItem` and all subclasses. - Populates it from `element.isSynthetic` in `fromElement` factories. - Persists it in the binary format (written after `id`, before metadata) and reads it in all `read(...)` constructors. - Includes it in `ManifestItem.match(...)` so ID stability reflects synthetic ↔ explicit transitions. - Bumps `AnalysisDriver.DATA_VERSION` to 535 to invalidate old caches. Impact: switching between synthetic and explicit declarations now causes manifest ID changes and corrects fine-grained invalidation without affecting unrelated behavior. Change-Id: I6e4bc83f3f71573c3e6fa73c83857998585cc29d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448080 Reviewed-by: Johnni Winther <[email protected]> Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent eb3fdd7 commit 5ce6cd9

File tree

3 files changed

+268
-4
lines changed

3 files changed

+268
-4
lines changed

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ testFineAfterLibraryAnalyzerHook;
106106
// TODO(scheglov): Clean up the list of implicitly analyzed files.
107107
class AnalysisDriver {
108108
/// The version of data format, should be incremented on every format change.
109-
static const int DATA_VERSION = 536;
109+
static const int DATA_VERSION = 538;
110110

111111
/// The number of exception contexts allowed to write. Once this field is
112112
/// zero, we stop writing any new exception contexts in this process.

0 commit comments

Comments
 (0)