Skip to content

Commit 3f120e0

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Skip unnamed extensions from 'structureMismatched'.
Unnamed extensions cannot be referenced in any way, even inside the same library, in contrast to private named elements. We already skipped them while adding items to the library manifests. However we recorded unnamed extensions as `structureMismatchedCount`, which added noise. No new test because nothing is affected outside. Now, after changing a single public method in the analyzer: "(name: computeManifests, count: 1, elapsed: 0:00:00.146594, elapsedSelf: 0:00:00.146594)(libraryCount: 275, structureMatchedCount: 33907, structureMismatchedCount: 1, transitiveAffectedCount: 1, transitiveMatchedCount: 33907)" Change-Id: I7ab46bba1b0888f794889fe234d864a4d6a228fb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447822 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 563cc89 commit 3f120e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/analyzer/lib/src/fine/library_manifest.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,10 @@ class _LibraryMatch {
11611161
structureMismatched.add(element);
11621162
}
11631163
case ExtensionElementImpl():
1164-
if (!_matchExtension(name: name, element: element)) {
1165-
structureMismatched.add(element);
1164+
if (name != null) {
1165+
if (!_matchExtension(name: name, element: element)) {
1166+
structureMismatched.add(element);
1167+
}
11661168
}
11671169
case ExtensionTypeElementImpl():
11681170
if (!_matchExtensionType(name: name, element: element)) {

0 commit comments

Comments
 (0)