| Index: pkg/analyzer/test/src/task/strong_mode_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/strong_mode_test.dart b/pkg/analyzer/test/src/task/strong_mode_test.dart
|
| index fa2877c944515890dfa813a34fc0bc54588655fd..ed3d8ca5686f602b5a0f7ce1bd2d0a142eb14b56 100644
|
| --- a/pkg/analyzer/test/src/task/strong_mode_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong_mode_test.dart
|
| @@ -4,16 +4,18 @@
|
|
|
| library analyzer.test.src.task.strong_mode_test;
|
|
|
| -import 'package:analyzer/dart/ast/ast.dart';
|
| +import 'dart:async';
|
| +
|
| import 'package:analyzer/dart/element/element.dart';
|
| import 'package:analyzer/dart/element/type.dart';
|
| import 'package:analyzer/src/dart/resolver/inheritance_manager.dart';
|
| +import 'package:analyzer/src/generated/engine.dart';
|
| import 'package:analyzer/src/generated/source.dart';
|
| import 'package:analyzer/src/task/strong_mode.dart';
|
| import 'package:test/test.dart';
|
| import 'package:test_reflective_loader/test_reflective_loader.dart';
|
|
|
| -import '../context/abstract_context.dart';
|
| +import '../../generated/resolver_test_case.dart';
|
|
|
| main() {
|
| defineReflectiveSuite(() {
|
| @@ -24,8 +26,9 @@ main() {
|
| }
|
|
|
| @reflectiveTest
|
| -class InstanceMemberInferrerTest extends AbstractContextTest {
|
| +class InstanceMemberInferrerTest extends ResolverTestCase {
|
| InstanceMemberInferrer createInferrer(LibraryElement library) {
|
| + AnalysisContext context = library.context;
|
| return new InstanceMemberInferrer(
|
| context.typeProvider, new InheritanceManager(library),
|
| typeSystem: context.typeSystem);
|
| @@ -35,20 +38,19 @@ class InstanceMemberInferrerTest extends AbstractContextTest {
|
| * Add a source with the given [content] and return the result of resolving
|
| * the source.
|
| */
|
| - CompilationUnitElement resolve(String content) {
|
| - Source source = addSource('/test.dart', content);
|
| - return context.resolveCompilationUnit2(source, source).element;
|
| - }
|
| -
|
| - void test_creation() {
|
| - InstanceMemberInferrer inferrer = createInferrer(null);
|
| - expect(inferrer, isNotNull);
|
| - expect(inferrer.typeSystem, isNotNull);
|
| + Future<CompilationUnitElement> resolve(String content) async {
|
| + Source source = addNamedSource('/test.dart', content);
|
| + if (enableNewAnalysisDriver) {
|
| + var analysisResult = await computeAnalysisResult(source);
|
| + return analysisResult.unit.element;
|
| + } else {
|
| + return analysisContext.resolveCompilationUnit2(source, source).element;
|
| + }
|
| }
|
|
|
| - void test_inferCompilationUnit_field_multiple_different() {
|
| + test_inferCompilationUnit_field_multiple_different() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $fieldName;
|
| }
|
| @@ -71,9 +73,9 @@ class C implements A, B {
|
| expect(getterC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_multiple_different_generic() {
|
| + test_inferCompilationUnit_field_multiple_different_generic() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| E $fieldName;
|
| }
|
| @@ -96,9 +98,9 @@ class C implements A<int>, B<double> {
|
| expect(getterC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_multiple_dynamic() {
|
| + test_inferCompilationUnit_field_multiple_dynamic() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $fieldName;
|
| }
|
| @@ -121,9 +123,9 @@ class C implements A, B {
|
| expect(getterC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_multiple_same() {
|
| + test_inferCompilationUnit_field_multiple_same() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $fieldName;
|
| }
|
| @@ -149,9 +151,9 @@ class C implements A, B {
|
| expect(getterC.returnType, expectedType);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_noOverride() {
|
| + test_inferCompilationUnit_field_noOverride() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| final $fieldName = 0;
|
| }
|
| @@ -169,9 +171,9 @@ class A {
|
| expect(getterA.returnType, intType);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_noOverride_bottom() {
|
| + test_inferCompilationUnit_field_noOverride_bottom() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| var $fieldName = null;
|
| }
|
| @@ -188,9 +190,9 @@ class A {
|
| expect(getterA.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_single_explicitlyDynamic() {
|
| + test_inferCompilationUnit_field_single_explicitlyDynamic() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| dynamic $fieldName;
|
| }
|
| @@ -213,9 +215,9 @@ class B extends A {
|
| expect(getterB.returnType, getterA.returnType);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_single_final() {
|
| + test_inferCompilationUnit_field_single_final() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| final int $fieldName;
|
| }
|
| @@ -238,9 +240,9 @@ class B extends A {
|
| expect(getterB.returnType, getterA.returnType);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_single_final_narrowType() {
|
| + test_inferCompilationUnit_field_single_final_narrowType() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| final $fieldName;
|
| }
|
| @@ -260,9 +262,9 @@ class B extends A {
|
| expect(getterB.returnType, fieldB.type);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_single_generic() {
|
| + test_inferCompilationUnit_field_single_generic() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| E $fieldName;
|
| }
|
| @@ -283,9 +285,9 @@ class B<E> extends A<E> {
|
| expect(getterB.returnType, typeBE);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_single_inconsistentAccessors() {
|
| + test_inferCompilationUnit_field_single_inconsistentAccessors() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int get $fieldName => 0;
|
| set $fieldName(String value) {}
|
| @@ -306,9 +308,9 @@ class B extends A {
|
| expect(getterB.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_field_single_noModifiers() {
|
| + test_inferCompilationUnit_field_single_noModifiers() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $fieldName;
|
| }
|
| @@ -331,9 +333,9 @@ class B extends A {
|
| expect(getterB.returnType, getterA.returnType);
|
| }
|
|
|
| - void test_inferCompilationUnit_fieldFormal() {
|
| + test_inferCompilationUnit_fieldFormal() async {
|
| String fieldName = 'f';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| final $fieldName = 0;
|
| A([this.$fieldName = 'hello']);
|
| @@ -353,9 +355,9 @@ class A {
|
| expect(paramA.type, intType);
|
| }
|
|
|
| - void test_inferCompilationUnit_getter_multiple_different() {
|
| + test_inferCompilationUnit_getter_multiple_different() async {
|
| String getterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int get $getterName => 0;
|
| }
|
| @@ -378,9 +380,9 @@ class C implements A, B {
|
| expect(getterC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_getter_multiple_dynamic() {
|
| + test_inferCompilationUnit_getter_multiple_dynamic() async {
|
| String getterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int get $getterName => 0;
|
| }
|
| @@ -403,9 +405,9 @@ class C implements A, B {
|
| expect(getterC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_getter_multiple_same() {
|
| + test_inferCompilationUnit_getter_multiple_same() async {
|
| String getterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| String get $getterName => '';
|
| }
|
| @@ -431,9 +433,9 @@ class C implements A, B {
|
| expect(getterC.returnType, expectedType);
|
| }
|
|
|
| - void test_inferCompilationUnit_getter_single() {
|
| + test_inferCompilationUnit_getter_single() async {
|
| String getterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int get $getterName => 0;
|
| }
|
| @@ -456,9 +458,9 @@ class B extends A {
|
| expect(getterB.returnType, getterA.returnType);
|
| }
|
|
|
| - void test_inferCompilationUnit_getter_single_generic() {
|
| + test_inferCompilationUnit_getter_single_generic() async {
|
| String getterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| E get $getterName => 0;
|
| }
|
| @@ -479,9 +481,9 @@ class B<E> extends A<E> {
|
| expect(getterB.returnType, typeBE);
|
| }
|
|
|
| - void test_inferCompilationUnit_getter_single_inconsistentAccessors() {
|
| + test_inferCompilationUnit_getter_single_inconsistentAccessors() async {
|
| String getterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int get $getterName => 0;
|
| set $getterName(String value) {}
|
| @@ -507,8 +509,8 @@ class B extends A {
|
| expect(getterB.returnType, getterA.returnType);
|
| }
|
|
|
| - void test_inferCompilationUnit_invalid_inheritanceCycle() {
|
| - CompilationUnitElement unit = resolve('''
|
| + test_inferCompilationUnit_invalid_inheritanceCycle() async {
|
| + CompilationUnitElement unit = await resolve('''
|
| class A extends C {}
|
| class B extends A {}
|
| class C extends B {}
|
| @@ -516,9 +518,9 @@ class C extends B {}
|
| _runInferrer(unit);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_parameter_multiple_different() {
|
| + test_inferCompilationUnit_method_parameter_multiple_different() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| $methodName(int p) => 0;
|
| }
|
| @@ -539,9 +541,9 @@ class C implements A, B {
|
| expect(parameterC.type.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_parameter_multiple_named_different() {
|
| + test_inferCompilationUnit_method_parameter_multiple_named_different() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| $methodName({int p}) => 0;
|
| }
|
| @@ -562,9 +564,9 @@ class C implements A, B {
|
| expect(parameterC.type.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_parameter_multiple_named_same() {
|
| + test_inferCompilationUnit_method_parameter_multiple_named_same() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| $methodName({int p}) => 0;
|
| }
|
| @@ -589,9 +591,9 @@ class C implements A, B {
|
| expect(parameterC.type, expectedType);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_parameter_multiple_namedAndRequired() {
|
| + test_inferCompilationUnit_method_parameter_multiple_namedAndRequired() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| $methodName({int p}) => 0;
|
| }
|
| @@ -612,10 +614,9 @@ class C implements A, B {
|
| expect(parameterC.type.isDynamic, isTrue);
|
| }
|
|
|
| - void
|
| - test_inferCompilationUnit_method_parameter_multiple_optionalAndRequired() {
|
| + test_inferCompilationUnit_method_parameter_multiple_optionalAndRequired() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| $methodName(int p) => 0;
|
| }
|
| @@ -640,9 +641,9 @@ class C implements A, B {
|
| expect(parameterC.type, expectedType);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_parameter_single_generic() {
|
| + test_inferCompilationUnit_method_parameter_single_generic() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| $methodName(E p) => 0;
|
| }
|
| @@ -664,9 +665,9 @@ class C<E> implements A<E> {
|
| reason: 'function type should still have type arguments');
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_multiple_different() {
|
| + test_inferCompilationUnit_method_return_multiple_different() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $methodName() => 0;
|
| }
|
| @@ -686,9 +687,9 @@ class C implements A, B {
|
| expect(methodC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_multiple_different_generic() {
|
| + test_inferCompilationUnit_method_return_multiple_different_generic() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| E $methodName() => null;
|
| }
|
| @@ -708,9 +709,9 @@ class C implements A<int>, B<double> {
|
| expect(methodC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_multiple_dynamic() {
|
| + test_inferCompilationUnit_method_return_multiple_dynamic() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $methodName() => 0;
|
| }
|
| @@ -730,9 +731,9 @@ class C implements A, B {
|
| expect(methodC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_multiple_same_generic() {
|
| + test_inferCompilationUnit_method_return_multiple_same_generic() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| E $methodName() => 0;
|
| }
|
| @@ -752,9 +753,9 @@ class C<E> implements A<E>, B<E> {
|
| expect(methodC.returnType, classC.typeParameters[0].type);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_multiple_same_nonVoid() {
|
| + test_inferCompilationUnit_method_return_multiple_same_nonVoid() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $methodName() => 0;
|
| }
|
| @@ -777,9 +778,9 @@ class C implements A, B {
|
| expect(methodC.returnType, expectedType);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_multiple_same_void() {
|
| + test_inferCompilationUnit_method_return_multiple_same_void() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| void $methodName() {};
|
| }
|
| @@ -802,9 +803,9 @@ class C implements A, B {
|
| expect(methodC.returnType, expectedType);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_multiple_void() {
|
| + test_inferCompilationUnit_method_return_multiple_void() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $methodName() => 0;
|
| }
|
| @@ -824,9 +825,9 @@ class C implements A, B {
|
| expect(methodC.returnType.isDynamic, isTrue);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_single() {
|
| + test_inferCompilationUnit_method_return_single() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int $methodName() => 0;
|
| }
|
| @@ -845,9 +846,9 @@ class B extends A {
|
| expect(methodB.returnType, methodA.returnType);
|
| }
|
|
|
| - void test_inferCompilationUnit_method_return_single_generic() {
|
| + test_inferCompilationUnit_method_return_single_generic() async {
|
| String methodName = 'm';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| E $methodName() => 0;
|
| }
|
| @@ -868,9 +869,9 @@ class B<E> extends A<E> {
|
| reason: 'function type should still have type arguments');
|
| }
|
|
|
| - void test_inferCompilationUnit_setter_single() {
|
| + test_inferCompilationUnit_setter_single() async {
|
| String setterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| set $setterName(int x) {}
|
| }
|
| @@ -893,9 +894,9 @@ class B extends A {
|
| expect(setterB.parameters[0].type, setterA.parameters[0].type);
|
| }
|
|
|
| - void test_inferCompilationUnit_setter_single_generic() {
|
| + test_inferCompilationUnit_setter_single_generic() async {
|
| String setterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A<E> {
|
| set $setterName(E x) {}
|
| }
|
| @@ -916,9 +917,9 @@ class B<E> extends A<E> {
|
| expect(setterB.parameters[0].type, typeBE);
|
| }
|
|
|
| - void test_inferCompilationUnit_setter_single_inconsistentAccessors() {
|
| + test_inferCompilationUnit_setter_single_inconsistentAccessors() async {
|
| String getterName = 'g';
|
| - CompilationUnitElement unit = resolve('''
|
| + CompilationUnitElement unit = await resolve('''
|
| class A {
|
| int get $getterName => 0;
|
| set $getterName(String value) {}
|
| @@ -954,39 +955,36 @@ class B extends A {
|
| }
|
|
|
| @reflectiveTest
|
| -class SetFieldTypeTest extends AbstractContextTest {
|
| - void test_setter_withoutParameter() {
|
| - CompilationUnitElement unit = _resolve('''
|
| +class SetFieldTypeTest extends ResolverTestCase {
|
| + test_setter_withoutParameter() async {
|
| + Source source = addSource('''
|
| var x = 0;
|
| set x() {}
|
| ''');
|
| + var analysisResult = await computeAnalysisResult(source);
|
| + CompilationUnitElement unit = analysisResult.unit.element;
|
| TopLevelVariableElement variable = unit.topLevelVariables.single;
|
| - setFieldType(variable, context.typeProvider.intType);
|
| - }
|
| -
|
| - CompilationUnitElement _resolve(String content) {
|
| - Source source = addSource('/test.dart', content);
|
| - return context.resolveCompilationUnit2(source, source).element;
|
| + setFieldType(variable, unit.context.typeProvider.intType);
|
| }
|
| }
|
|
|
| @reflectiveTest
|
| -class VariableGathererTest extends AbstractContextTest {
|
| - void test_creation_withFilter() {
|
| +class VariableGathererTest extends ResolverTestCase {
|
| + test_creation_withFilter() async {
|
| VariableFilter filter = (variable) => true;
|
| VariableGatherer gatherer = new VariableGatherer(filter);
|
| expect(gatherer, isNotNull);
|
| expect(gatherer.filter, filter);
|
| }
|
|
|
| - void test_creation_withoutFilter() {
|
| + test_creation_withoutFilter() async {
|
| VariableGatherer gatherer = new VariableGatherer();
|
| expect(gatherer, isNotNull);
|
| expect(gatherer.filter, isNull);
|
| }
|
|
|
| - void test_visit_noReferences() {
|
| - Source source = addSource(
|
| + test_visit_noReferences() async {
|
| + Source source = addNamedSource(
|
| '/test.dart',
|
| '''
|
| library lib;
|
| @@ -997,23 +995,25 @@ class C {
|
| }
|
| typedef void F();
|
| ''');
|
| - CompilationUnit unit = context.resolveCompilationUnit2(source, source);
|
| + var analysisResult = await computeAnalysisResult(source);
|
| VariableGatherer gatherer = new VariableGatherer();
|
| - unit.accept(gatherer);
|
| + analysisResult.unit.accept(gatherer);
|
| expect(gatherer.results, hasLength(0));
|
| }
|
|
|
| - void test_visit_withFilter() {
|
| + test_visit_withFilter() async {
|
| VariableFilter filter = (VariableElement variable) => variable.isStatic;
|
| - expect(_gather(filter), hasLength(1));
|
| + Set<VariableElement> variables = await _gather(filter);
|
| + expect(variables, hasLength(1));
|
| }
|
|
|
| - void test_visit_withoutFilter() {
|
| - expect(_gather(), hasLength(4));
|
| + test_visit_withoutFilter() async {
|
| + Set<VariableElement> variables = await _gather();
|
| + expect(variables, hasLength(4));
|
| }
|
|
|
| - Set<VariableElement> _gather([VariableFilter filter = null]) {
|
| - Source source = addSource(
|
| + Future<Set<VariableElement>> _gather([VariableFilter filter = null]) async {
|
| + Source source = addNamedSource(
|
| '/test.dart',
|
| '''
|
| const int zero = 0;
|
| @@ -1032,9 +1032,9 @@ class Counter {
|
| }
|
| }
|
| ''');
|
| - CompilationUnit unit = context.resolveCompilationUnit2(source, source);
|
| + var analysisResult = await computeAnalysisResult(source);
|
| VariableGatherer gatherer = new VariableGatherer(filter);
|
| - unit.accept(gatherer);
|
| + analysisResult.unit.accept(gatherer);
|
| return gatherer.results;
|
| }
|
| }
|
|
|