From b44ff920b1a07a6c88bd59f47339a46e4c8b31a1 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Tue, 16 Sep 2025 14:07:41 -0700 Subject: [PATCH] Fine. Make LibraryElementImpl.fieldNameNonPromotabilityInfo @trackedDirectlyOpaque I don't expect that it is used for any other library than the one we are resolving. So, recorded opaque API usage will be ignored. Change-Id: Id914e9eb498b769bbffe1cc77a1d118bb8d36c17 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449923 Commit-Queue: Konstantin Shcheglov Reviewed-by: Paul Berry --- pkg/analyzer/lib/src/dart/element/element.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart index 96ca1e30b82..7171cbe4b59 100644 --- a/pkg/analyzer/lib/src/dart/element/element.dart +++ b/pkg/analyzer/lib/src/dart/element/element.dart @@ -6171,8 +6171,13 @@ class LibraryElementImpl extends ElementImpl /// /// If a field in the library has a private name and that name does not appear /// as a key in this map, the field is promotable. + @trackedDirectlyOpaque Map get fieldNameNonPromotabilityInfo { _ensureReadResolution(); + globalResultRequirements?.recordOpaqueApiUse( + this, + 'fieldNameNonPromotabilityInfo', + ); return _fieldNameNonPromotabilityInfo!; }