| Index: pkg/analyzer/test/generated/simple_resolver_test.dart
|
| diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart
|
| index db6a8bd7b1d9d5eaa94d1e4473fd98653bc563af..32004199f86fd03c9eec398b97729c936a2f8ecd 100644
|
| --- a/pkg/analyzer/test/generated/simple_resolver_test.dart
|
| +++ b/pkg/analyzer/test/generated/simple_resolver_test.dart
|
| @@ -397,6 +397,7 @@ class A {
|
| int f(A a) {
|
| return a(0);
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -406,6 +407,7 @@ int f(A a) {
|
| class A extends B implements C {}
|
| class B {}
|
| class C {}''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -419,6 +421,7 @@ class A {
|
| A.n() {}
|
| m() {}
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -431,6 +434,7 @@ class A {
|
| /** [e] [f] */
|
| m(e, f()) {}
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -439,6 +443,7 @@ class A {
|
| Source source = addSource(r'''
|
| /// [A]
|
| class A {}''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -572,6 +577,7 @@ void f() {
|
|
|
| test_empty() async {
|
| Source source = addSource("");
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -592,6 +598,7 @@ export 'two.dart';''');
|
| FunctionElement main = library.entryPoint;
|
| expect(main, isNotNull);
|
| expect(main.library, isNot(same(library)));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -607,6 +614,7 @@ main() {}''');
|
| FunctionElement main = library.entryPoint;
|
| expect(main, isNotNull);
|
| expect(main.library, same(library));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -616,6 +624,7 @@ main() {}''');
|
| LibraryElement library = resolve2(source);
|
| expect(library, isNotNull);
|
| expect(library.entryPoint, isNull);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -631,6 +640,7 @@ import 'my_lib.dart';
|
| main() {
|
| EEE e = null;
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -644,6 +654,7 @@ abstract class Comparable<T> {
|
| class A {
|
| void sort([compare = Comparable.compare]) {}
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -669,6 +680,7 @@ class A {
|
| SimpleIdentifier identifierX = initializer.expression;
|
| expect(identifierX.staticElement, paramElement);
|
|
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -680,6 +692,7 @@ f() {
|
| for (int x in list) {}
|
| for (int x in list) {}
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -692,6 +705,7 @@ f() {
|
| for (int i = 0; i < 3; i++) {
|
| }
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -705,6 +719,7 @@ class A {
|
| if (p(e)) {}
|
| }
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -727,6 +742,7 @@ class C extends B with M1, M2 {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that both the getter and setter for "x" in C.f() refer to the
|
| @@ -768,6 +784,7 @@ void main() {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that both the getter and setter for "x" in "new C().x" refer to
|
| @@ -806,6 +823,7 @@ class C extends B with M1, M2 {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that the getter for "x" in C.f() refers to the getter defined in
|
| @@ -834,6 +852,7 @@ void main() {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that the getter for "x" in "new C().x" refers to the getter
|
| @@ -860,6 +879,7 @@ class A {
|
| g (A a) {
|
| a.f = a.f.toString();
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertErrors(
|
| source, [StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES]);
|
| verify([source]);
|
| @@ -877,6 +897,7 @@ class B {toString() => super.toString();}''');
|
| expect(classes, hasLength(2));
|
| expect(classes[0].hasReferenceToSuper, isFalse);
|
| expect(classes[1].hasReferenceToSuper, isTrue);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -903,6 +924,7 @@ main() {
|
| foo = 0;
|
| }
|
| A a;''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -923,6 +945,7 @@ import 'two.dart' as _two;
|
| main() {
|
| _two.f(0);
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -952,6 +975,7 @@ class H extends D<p.W> {
|
| H(int i) : super(i);
|
| }
|
| ''');
|
| + await computeAnalysisResult(source);
|
| await assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
|
| verify([source]);
|
| }
|
| @@ -981,6 +1005,7 @@ class H extends D<W> {
|
| H(int i) : super(i);
|
| }
|
| ''');
|
| + await computeAnalysisResult(source);
|
| await assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
|
| verify([source]);
|
| }
|
| @@ -999,6 +1024,7 @@ import 'sub folder/lib.dart';
|
| main() {
|
| foo();
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1013,6 +1039,7 @@ f() {
|
| List<List<List<int>>> c;
|
| c[0][0][0];
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1023,6 +1050,7 @@ f() {
|
| List<List<int>> b;
|
| b[0][0] = 'hi';
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
|
| verify([source]);
|
| }
|
| @@ -1044,6 +1072,7 @@ g(int x) {}
|
| main() {
|
| g(f()[0]);
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1056,6 +1085,7 @@ class A {
|
| X.last;
|
| }
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1071,6 +1101,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isFalse);
|
| + await computeAnalysisResult(source);
|
| await assertErrors(
|
| source, [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]);
|
| verify([source]);
|
| @@ -1088,6 +1119,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isTrue);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1104,6 +1136,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isFalse);
|
| + await computeAnalysisResult(source);
|
| await assertErrors(
|
| source, [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]);
|
| verify([source]);
|
| @@ -1122,6 +1155,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isFalse);
|
| + await computeAnalysisResult(source);
|
| await assertErrors(
|
| source, [CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR]);
|
| verify([source]);
|
| @@ -1139,6 +1173,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isTrue);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1156,6 +1191,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isTrue);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1174,6 +1210,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isFalse);
|
| + await computeAnalysisResult(source);
|
| await assertErrors(source, [CompileTimeErrorCode.MIXIN_REFERENCES_SUPER]);
|
| verify([source]);
|
| }
|
| @@ -1193,6 +1230,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isTrue);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1207,6 +1245,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isTrue);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1222,6 +1261,7 @@ class C = Object with A;''');
|
| expect(unit, isNotNull);
|
| ClassElement a = unit.getType('A');
|
| expect(a.isValidMixin, isTrue);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1240,6 +1280,7 @@ void doSwitch(int target) {
|
| }''');
|
| LibraryElement library = resolve2(source);
|
| expect(library, isNotNull);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1279,6 +1320,7 @@ const A = null;
|
| expect(classes, hasLength(1));
|
| List<ElementAnnotation> annotations = classes[0].metadata;
|
| expect(annotations, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| @@ -1312,6 +1354,7 @@ class C {
|
| FieldElement field = classes[0].fields[0];
|
| List<ElementAnnotation> annotations = field.metadata;
|
| expect(annotations, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1335,6 +1378,7 @@ class C {
|
| expect(parameters, hasLength(1));
|
| List<ElementAnnotation> annotations = parameters[0].metadata;
|
| expect(annotations, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1351,6 +1395,7 @@ const A = null;
|
| expect(functions, hasLength(1));
|
| List<ElementAnnotation> annotations = functions[0].metadata;
|
| expect(annotations, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1369,6 +1414,7 @@ f(@A int p(int x)) {}''');
|
| expect(parameters, hasLength(1));
|
| List<ElementAnnotation> annotations1 = parameters[0].metadata;
|
| expect(annotations1, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1381,6 +1427,7 @@ const A = null;''');
|
| expect(library, isNotNull);
|
| List<ElementAnnotation> annotations = library.metadata;
|
| expect(annotations, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1400,6 +1447,7 @@ class C {
|
| MethodElement method = classes[0].methods[0];
|
| List<ElementAnnotation> annotations = method.metadata;
|
| expect(annotations, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1418,6 +1466,7 @@ f({@A int p : 0}) {}''');
|
| expect(parameters, hasLength(1));
|
| List<ElementAnnotation> annotations1 = parameters[0].metadata;
|
| expect(annotations1, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1436,6 +1485,7 @@ f([@A int p = 0]) {}''');
|
| expect(parameters, hasLength(1));
|
| List<ElementAnnotation> annotations1 = parameters[0].metadata;
|
| expect(annotations1, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1456,6 +1506,7 @@ f(@A p1, @A int p2) {}''');
|
| expect(annotations1, hasLength(1));
|
| List<ElementAnnotation> annotations2 = parameters[1].metadata;
|
| expect(annotations2, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1472,6 +1523,7 @@ const A = null;
|
| expect(aliases, hasLength(1));
|
| List<ElementAnnotation> annotations = aliases[0].metadata;
|
| expect(annotations, hasLength(1));
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| CompilationUnit unit = resolveCompilationUnit(source, library);
|
| @@ -1503,6 +1555,7 @@ class C extends B with A {
|
| bar() => super.bar();
|
| foo() => super.foo();
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1522,6 +1575,7 @@ void main() {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that the "f" in "new C().f()" refers to the "f" defined in M2.
|
| @@ -1554,6 +1608,7 @@ class C extends B with M1, M2 {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that the call to f() in C.g() refers to the method defined in M2.
|
| @@ -1586,6 +1641,7 @@ void main() {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that the call to f() in "new C().f()" refers to the method
|
| @@ -1615,6 +1671,7 @@ class C extends B {
|
| f(C c) {
|
| c.m1();
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1630,6 +1687,7 @@ class A {
|
| ..m2();
|
| }
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1648,6 +1706,7 @@ class A {
|
| }
|
| }''');
|
| // failing with error code: INVOCATION_OF_NON_FUNCTION
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1657,6 +1716,7 @@ class A {
|
| f(var p) {
|
| return null == p;
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| }
|
|
|
| @@ -1676,6 +1736,7 @@ class C extends B with M1, M2 {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that the setter for "x" in C.f() refers to the setter defined in
|
| @@ -1709,6 +1770,7 @@ void main() {
|
| }
|
| ''');
|
| LibraryElement library = resolve2(source);
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| // Verify that the setter for "x" in "new C().x" refers to the setter
|
| @@ -1737,6 +1799,7 @@ class B extends A {
|
| int get x => super.x == null ? 0 : super.x;
|
| int f() => x = 1;
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1749,6 +1812,7 @@ set s(x) {
|
| main() {
|
| s = 123;
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
| @@ -1764,6 +1828,7 @@ class B {
|
| A.g(1,0);
|
| }
|
| }''');
|
| + await computeAnalysisResult(source);
|
| await assertNoErrors(source);
|
| verify([source]);
|
| }
|
|
|