Skip to content

Commit

Permalink
Version 3.6.0-203.0.dev
Browse files Browse the repository at this point in the history
Merge 0d71b28 into dev
  • Loading branch information
Dart CI committed Aug 30, 2024
2 parents 6347fca + 0d71b28 commit 2e8f93c
Show file tree
Hide file tree
Showing 43 changed files with 589 additions and 638 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ vars = {

# co19 is a cipd package automatically generated for each co19 commit.
# Use tests/co19/update.sh to update this hash.
"co19_rev": "b68706957297de92e936c4339d327cffc187b30e",
"co19_rev": "767bb1f623a4f005072224cd7a49726a5b644296",

# The internal benchmarks to use. See go/dart-benchmarks-internal
"benchmarks_internal_rev": "3bd6bc6d207dfb7cf687537e819863cf9a8f2470",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void f(Old o) {}
import '$importUri';
void f(New o) {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_replacedBy() async {
Expand Down Expand Up @@ -193,6 +193,6 @@ import 'dart:io';
int f() {
return FileMode.read;
}
''');
''', errorFilter: ignoreUnusedImport);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import '$importUri';
void f() {
CupertinoAlertDialog(content: 'x');
}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void>
Expand Down Expand Up @@ -171,7 +171,7 @@ import '$importUri';
void f() {
CupertinoPopupSurface(child: 'x');
}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ import '$importUri';
void f() {
New.c();
}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_constructor_unnamed_deprecated() async {
Expand Down Expand Up @@ -175,7 +175,7 @@ import '$importUri';
void f() {
New();
}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_constructor_unnamed_removed_prefixed() async {
Expand Down Expand Up @@ -234,7 +234,7 @@ class C extends Old {}
import '$importUri';
class C extends New {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_inImplements_deprecated() async {
Expand Down Expand Up @@ -270,7 +270,7 @@ class C implements Old {}
import '$importUri';
class C implements New {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_inOn_deprecated() async {
Expand Down Expand Up @@ -306,7 +306,7 @@ extension E on Old {}
import '$importUri';
extension E on New {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_inTypeAnnotation_deprecated() async {
Expand Down Expand Up @@ -342,7 +342,7 @@ void f(Old o) {}
import '$importUri';
void f(New o) {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_inTypeArgument_deprecated() async {
Expand Down Expand Up @@ -430,7 +430,7 @@ class C with Old {}
import '$importUri';
class C with New {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_staticField_deprecated() async {
Expand Down Expand Up @@ -472,7 +472,7 @@ var s = Old.empty;
import '$importUri';
var s = New.empty;
''');
''', errorFilter: ignoreUnusedImport);
}
}

Expand Down Expand Up @@ -693,7 +693,7 @@ var l = Old('a').double;
import '$importUri';
var l = New('a').double;
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_staticField_deprecated() async {
Expand Down Expand Up @@ -735,7 +735,7 @@ var s = Old.empty;
import '$importUri';
var s = New.empty;
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_staticField_removed_prefixed() async {
Expand Down Expand Up @@ -1176,7 +1176,7 @@ import '$importUri';
void f() {
b;
}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_topLevel_reference_removed_prefixed() async {
Expand Down Expand Up @@ -1417,7 +1417,7 @@ class C with Old {}
import '$importUri';
class C with New {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_inWith_removed_prefixed() async {
Expand Down Expand Up @@ -1515,7 +1515,7 @@ import '$importUri';
void f() {
b();
}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_removed_prefixed() async {
Expand Down Expand Up @@ -1661,7 +1661,7 @@ void f(Old o) {}
import '$importUri';
void f(New o) {}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_removed_prefixed() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ import '$importUri';
f() {
expect(true, true);
}
''');
''', errorFilter: ignoreUnusedImport);
}

Future<void> test_new_element_uris_single() async {
Expand Down Expand Up @@ -1102,7 +1102,7 @@ import '$importUri';
main() {
expect(true, true);
}
''');
''', errorFilter: ignoreUnusedImport);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void f(Foo o) {}
import '$importUri';
void f(Bar o) {}
''');
''', errorFilter: ignoreUnusedImport);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ import '$importUri';
main() {
expect(true, true);
}
''');
''', errorFilter: ignoreUnusedImport);
}
}
2 changes: 0 additions & 2 deletions pkg/analyzer/lib/src/dart/analysis/file_analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:analyzer/error/listener.dart';
import 'package:analyzer/src/dart/analysis/file_state.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/scope.dart';
import 'package:analyzer/src/ignore_comments/ignore_info.dart';

/// Information about a file being analyzed.
Expand All @@ -17,7 +16,6 @@ class FileAnalysis {
final CompilationUnitImpl unit;
final CompilationUnitElementImpl element;
final IgnoreInfo ignoreInfo;
late ImportsTracking importsTracking;

FileAnalysis({
required this.file,
Expand Down
52 changes: 11 additions & 41 deletions pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,11 @@ class LibraryAnalyzer {
_testingData?.recordFlowAnalysisDataForTesting(
file.uri, flowAnalysisHelper.dataForTesting!);

var resolverVisitor = ResolverVisitor(
_inheritance,
_libraryElement,
libraryResolutionContext,
file.source,
_typeProvider,
errorListener,
featureSet: _libraryElement.featureSet,
analysisOptions: _library.file.analysisOptions,
flowAnalysisHelper: flowAnalysisHelper,
libraryFragment: unitElement,
);
var resolverVisitor = ResolverVisitor(_inheritance, _libraryElement,
libraryResolutionContext, file.source, _typeProvider, errorListener,
featureSet: _libraryElement.featureSet,
analysisOptions: _library.file.analysisOptions,
flowAnalysisHelper: flowAnalysisHelper);
_testingData?.recordTypeConstraintGenerationDataForTesting(
file.uri, resolverVisitor.inferenceHelper.dataForTesting!);

Expand Down Expand Up @@ -505,9 +498,7 @@ class LibraryAnalyzer {

// Verify imports.
{
var verifier = ImportsVerifier(
fileAnalysis: fileAnalysis,
);
ImportsVerifier verifier = ImportsVerifier();
verifier.addImports(unit);
usedImportedElements.forEach(verifier.removeUsedElements);
verifier.generateDuplicateExportWarnings(errorReporter);
Expand Down Expand Up @@ -627,24 +618,10 @@ class LibraryAnalyzer {
fileElement: _libraryElement.definingCompilationUnit,
);

// Configure scopes for all files to track imports usages.
// Associate tracking objects with file objects.
for (var fileAnalysis in _libraryFiles.values) {
var scope = fileAnalysis.element.scope;
var tracking = scope.importsTrackingInit();
fileAnalysis.importsTracking = tracking;
}

for (var fileAnalysis in _libraryFiles.values) {
_resolveFile(fileAnalysis);
}

// Stop tracking usages by scopes.
for (var fileAnalysis in _libraryFiles.values) {
var scope = fileAnalysis.element.scope;
scope.importsTrackingDestroy();
}

_computeConstants();
}

Expand Down Expand Up @@ -934,18 +911,11 @@ class LibraryAnalyzer {
_testingData?.recordFlowAnalysisDataForTesting(
fileAnalysis.file.uri, flowAnalysisHelper.dataForTesting!);

var resolver = ResolverVisitor(
_inheritance,
_libraryElement,
libraryResolutionContext,
source,
_typeProvider,
errorListener,
analysisOptions: _library.file.analysisOptions,
featureSet: unit.featureSet,
flowAnalysisHelper: flowAnalysisHelper,
libraryFragment: unitElement,
);
var resolver = ResolverVisitor(_inheritance, _libraryElement,
libraryResolutionContext, source, _typeProvider, errorListener,
analysisOptions: _library.file.analysisOptions,
featureSet: unit.featureSet,
flowAnalysisHelper: flowAnalysisHelper);
unit.accept(resolver);
_testingData?.recordTypeConstraintGenerationDataForTesting(
fileAnalysis.file.uri, resolver.inferenceHelper.dataForTesting!);
Expand Down
Loading

0 comments on commit 2e8f93c

Please sign in to comment.