| Index: pkg/analyzer/test/src/task/dart_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
|
| index 41f9c0c3c7b341822724269d30033c49fc9712e5..b73eeae57c51c739471bd2e94fbe15f7fb5970de 100644
|
| --- a/pkg/analyzer/test/src/task/dart_test.dart
|
| +++ b/pkg/analyzer/test/src/task/dart_test.dart
|
| @@ -1833,6 +1833,32 @@ var d4 = 4;
|
| getTopLevelVariableElement(unit, 'd2')
|
| ]));
|
| }
|
| +
|
| + test_perform_topLevel_ignoreLocal() {
|
| + AnalysisTarget source = newSource(
|
| + '/test.dart',
|
| + '''
|
| +final a = () {
|
| + const b = 2;
|
| + const c = 3;
|
| + return b + c;
|
| +}() + d;
|
| +final d = 4;
|
| +''');
|
| + LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
|
| + computeResult(target, RESOLVED_UNIT5);
|
| + CompilationUnit unit = outputs[RESOLVED_UNIT5];
|
| + TopLevelVariableElement elementA = getTopLevelVariableElement(unit, 'a');
|
| + // compute
|
| + computeResult(elementA, PROPAGABLE_VARIABLE_DEPENDENCIES,
|
| + matcher: isComputePropagableVariableDependenciesTask);
|
| + // verify
|
| + expect(outputs, hasLength(1));
|
| + List<VariableElement> dependencies =
|
| + outputs[PROPAGABLE_VARIABLE_DEPENDENCIES];
|
| + expect(
|
| + dependencies, unorderedEquals([getTopLevelVariableElement(unit, 'd')]));
|
| + }
|
| }
|
|
|
| @reflectiveTest
|
|
|