| Index: pkg/analyzer/test/generated/static_type_analyzer_test.dart
|
| diff --git a/pkg/analyzer/test/generated/static_type_analyzer_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
|
| index 9d92cf508b9eb8d3c60ddcebd124737972b8df5e..907770f22b9118d5ccdbd5bbb1411ba30435677b 100644
|
| --- a/pkg/analyzer/test/generated/static_type_analyzer_test.dart
|
| +++ b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
|
| @@ -41,17 +41,17 @@ main() {
|
| */
|
| @reflectiveTest
|
| class StaticTypeAnalyzer2Test extends StaticTypeAnalyzer2TestShared {
|
| - void test_FunctionExpressionInvocation_block() {
|
| + test_FunctionExpressionInvocation_block() async {
|
| String code = r'''
|
| main() {
|
| var foo = (() { return 1; })();
|
| }
|
| ''';
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| expectInitializerType('foo', 'dynamic', isNull);
|
| }
|
|
|
| - void test_FunctionExpressionInvocation_curried() {
|
| + test_FunctionExpressionInvocation_curried() async {
|
| String code = r'''
|
| typedef int F();
|
| F f() => null;
|
| @@ -59,21 +59,21 @@ main() {
|
| var foo = f()();
|
| }
|
| ''';
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| expectInitializerType('foo', 'int', isNull);
|
| }
|
|
|
| - void test_FunctionExpressionInvocation_expression() {
|
| + test_FunctionExpressionInvocation_expression() async {
|
| String code = r'''
|
| main() {
|
| var foo = (() => 1)();
|
| }
|
| ''';
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| expectInitializerType('foo', 'int', isNull);
|
| }
|
|
|
| - void test_MethodInvocation_nameType_localVariable() {
|
| + test_MethodInvocation_nameType_localVariable() async {
|
| String code = r"""
|
| typedef Foo();
|
| main() {
|
| @@ -81,24 +81,24 @@ main() {
|
| foo();
|
| }
|
| """;
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| // "foo" should be resolved to the "Foo" type
|
| expectIdentifierType("foo();", new isInstanceOf<FunctionType>());
|
| }
|
|
|
| - void test_MethodInvocation_nameType_parameter_FunctionTypeAlias() {
|
| + test_MethodInvocation_nameType_parameter_FunctionTypeAlias() async {
|
| String code = r"""
|
| typedef Foo();
|
| main(Foo foo) {
|
| foo();
|
| }
|
| """;
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| // "foo" should be resolved to the "Foo" type
|
| expectIdentifierType("foo();", new isInstanceOf<FunctionType>());
|
| }
|
|
|
| - void test_MethodInvocation_nameType_parameter_propagatedType() {
|
| + test_MethodInvocation_nameType_parameter_propagatedType() async {
|
| String code = r"""
|
| typedef Foo();
|
| main(p) {
|
| @@ -107,12 +107,12 @@ main(p) {
|
| }
|
| }
|
| """;
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| expectIdentifierType("p()", DynamicTypeImpl.instance,
|
| predicate((type) => type.name == 'Foo'));
|
| }
|
|
|
| - void test_staticMethods_classTypeParameters() {
|
| + test_staticMethods_classTypeParameters() async {
|
| String code = r'''
|
| class C<T> {
|
| static void m() => null;
|
| @@ -121,11 +121,11 @@ main() {
|
| print(C.m);
|
| }
|
| ''';
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| expectFunctionType('m);', '() → void');
|
| }
|
|
|
| - void test_staticMethods_classTypeParameters_genericMethod() {
|
| + test_staticMethods_classTypeParameters_genericMethod() async {
|
| String code = r'''
|
| class C<T> {
|
| static void m<S>(S s) {
|
| @@ -137,7 +137,7 @@ main() {
|
| print(C.m);
|
| }
|
| ''';
|
| - resolveTestUnit(code);
|
| + await resolveTestUnit(code);
|
| // C - m
|
| TypeParameterType typeS;
|
| {
|
| @@ -220,7 +220,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _analyzer = _createAnalyzer();
|
| }
|
|
|
| - void test_flatten_derived() {
|
| + test_flatten_derived() async {
|
| // class Derived<T> extends Future<T> { ... }
|
| ClassElementImpl derivedClass =
|
| ElementFactory.classElement2('Derived', ['T']);
|
| @@ -243,7 +243,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| derivedIntType);
|
| }
|
|
|
| - void test_flatten_inhibit_recursion() {
|
| + test_flatten_inhibit_recursion() async {
|
| // class A extends B
|
| // class B extends A
|
| ClassElementImpl classA = ElementFactory.classElement2('A', []);
|
| @@ -257,7 +257,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| expect(_flatten(classB.type), classB.type);
|
| }
|
|
|
| - void test_flatten_related_derived_types() {
|
| + test_flatten_related_derived_types() async {
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType numType = _typeProvider.numType;
|
| // class Derived<T> extends Future<T>
|
| @@ -285,7 +285,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| expect(_flatten(classB.type), intType);
|
| }
|
|
|
| - void test_flatten_related_types() {
|
| + test_flatten_related_types() async {
|
| InterfaceType futureType = _typeProvider.futureType;
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType numType = _typeProvider.numType;
|
| @@ -306,7 +306,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| expect(_flatten(classB.type), intType);
|
| }
|
|
|
| - void test_flatten_simple() {
|
| + test_flatten_simple() async {
|
| InterfaceType intType = _typeProvider.intType;
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| InterfaceType futureDynamicType = _typeProvider.futureDynamicType;
|
| @@ -330,7 +330,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| expect(_flatten(futureFutureIntType), intType);
|
| }
|
|
|
| - void test_flatten_unrelated_types() {
|
| + test_flatten_unrelated_types() async {
|
| InterfaceType futureType = _typeProvider.futureType;
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType stringType = _typeProvider.stringType;
|
| @@ -352,7 +352,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| expect(_flatten(classB.type), classB.type);
|
| }
|
|
|
| - void test_visitAdjacentStrings() {
|
| + test_visitAdjacentStrings() async {
|
| // "a" "b"
|
| Expression node = AstTestFactory
|
| .adjacentStrings([_resolvedString("a"), _resolvedString("b")]);
|
| @@ -360,7 +360,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitAsExpression() {
|
| + test_visitAsExpression() async {
|
| // class A { ... this as B ... }
|
| // class B extends A {}
|
| ClassElement superclass = ElementFactory.classElement2("A");
|
| @@ -372,7 +372,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitAssignmentExpression_compound_II() {
|
| + test_visitAssignmentExpression_compound_II() async {
|
| validate(TokenType operator) {
|
| InterfaceType numType = _typeProvider.numType;
|
| InterfaceType intType = _typeProvider.intType;
|
| @@ -392,7 +392,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| validate(TokenType.TILDE_SLASH_EQ);
|
| }
|
|
|
| - void test_visitAssignmentExpression_compound_lazy() {
|
| + test_visitAssignmentExpression_compound_lazy() async {
|
| validate(TokenType operator) {
|
| InterfaceType boolType = _typeProvider.boolType;
|
| SimpleIdentifier identifier = _resolvedVariable(boolType, "b");
|
| @@ -406,7 +406,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| validate(TokenType.BAR_BAR_EQ);
|
| }
|
|
|
| - void test_visitAssignmentExpression_compound_plusID() {
|
| + test_visitAssignmentExpression_compound_plusID() async {
|
| validate(TokenType operator) {
|
| InterfaceType numType = _typeProvider.numType;
|
| InterfaceType intType = _typeProvider.intType;
|
| @@ -426,7 +426,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| validate(TokenType.STAR_EQ);
|
| }
|
|
|
| - void test_visitAssignmentExpression_compoundIfNull_differentTypes() {
|
| + test_visitAssignmentExpression_compoundIfNull_differentTypes() async {
|
| // double d; d ??= 0
|
| Expression node = AstTestFactory.assignmentExpression(
|
| _resolvedVariable(_typeProvider.doubleType, 'd'),
|
| @@ -436,7 +436,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitAssignmentExpression_compoundIfNull_sameTypes() {
|
| + test_visitAssignmentExpression_compoundIfNull_sameTypes() async {
|
| // int i; i ??= 0
|
| Expression node = AstTestFactory.assignmentExpression(
|
| _resolvedVariable(_typeProvider.intType, 'i'),
|
| @@ -446,7 +446,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitAssignmentExpression_simple() {
|
| + test_visitAssignmentExpression_simple() async {
|
| // i = 0
|
| InterfaceType intType = _typeProvider.intType;
|
| Expression node = AstTestFactory.assignmentExpression(
|
| @@ -455,7 +455,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitAwaitExpression_flattened() {
|
| + test_visitAwaitExpression_flattened() async {
|
| // await e, where e has type Future<Future<int>>
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType futureIntType =
|
| @@ -468,7 +468,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitAwaitExpression_simple() {
|
| + test_visitAwaitExpression_simple() async {
|
| // await e, where e has type Future<int>
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType futureIntType =
|
| @@ -479,7 +479,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_equals() {
|
| + test_visitBinaryExpression_equals() async {
|
| // 2 == 3
|
| Expression node = AstTestFactory.binaryExpression(
|
| _resolvedInteger(2), TokenType.EQ_EQ, _resolvedInteger(3));
|
| @@ -487,7 +487,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_ifNull() {
|
| + test_visitBinaryExpression_ifNull() async {
|
| // 1 ?? 1.5
|
| Expression node = AstTestFactory.binaryExpression(
|
| _resolvedInteger(1), TokenType.QUESTION_QUESTION, _resolvedDouble(1.5));
|
| @@ -495,7 +495,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_logicalAnd() {
|
| + test_visitBinaryExpression_logicalAnd() async {
|
| // false && true
|
| Expression node = AstTestFactory.binaryExpression(
|
| AstTestFactory.booleanLiteral(false),
|
| @@ -505,7 +505,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_logicalOr() {
|
| + test_visitBinaryExpression_logicalOr() async {
|
| // false || true
|
| Expression node = AstTestFactory.binaryExpression(
|
| AstTestFactory.booleanLiteral(false),
|
| @@ -515,7 +515,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_minusID_propagated() {
|
| + test_visitBinaryExpression_minusID_propagated() async {
|
| // a - b
|
| BinaryExpression node = AstTestFactory.binaryExpression(
|
| _propagatedVariable(_typeProvider.intType, 'a'),
|
| @@ -527,7 +527,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_notEquals() {
|
| + test_visitBinaryExpression_notEquals() async {
|
| // 2 != 3
|
| Expression node = AstTestFactory.binaryExpression(
|
| _resolvedInteger(2), TokenType.BANG_EQ, _resolvedInteger(3));
|
| @@ -535,7 +535,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_plusID() {
|
| + test_visitBinaryExpression_plusID() async {
|
| // 1 + 2.0
|
| BinaryExpression node = AstTestFactory.binaryExpression(
|
| _resolvedInteger(1), TokenType.PLUS, _resolvedDouble(2.0));
|
| @@ -544,7 +544,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_plusII() {
|
| + test_visitBinaryExpression_plusII() async {
|
| // 1 + 2
|
| BinaryExpression node = AstTestFactory.binaryExpression(
|
| _resolvedInteger(1), TokenType.PLUS, _resolvedInteger(2));
|
| @@ -553,7 +553,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_plusII_propagated() {
|
| + test_visitBinaryExpression_plusII_propagated() async {
|
| // a + b
|
| BinaryExpression node = AstTestFactory.binaryExpression(
|
| _propagatedVariable(_typeProvider.intType, 'a'),
|
| @@ -565,7 +565,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_slash() {
|
| + test_visitBinaryExpression_slash() async {
|
| // 2 / 2
|
| BinaryExpression node = AstTestFactory.binaryExpression(
|
| _resolvedInteger(2), TokenType.SLASH, _resolvedInteger(2));
|
| @@ -574,7 +574,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_star_notSpecial() {
|
| + test_visitBinaryExpression_star_notSpecial() async {
|
| // class A {
|
| // A operator *(double value);
|
| // }
|
| @@ -594,7 +594,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBinaryExpression_starID() {
|
| + test_visitBinaryExpression_starID() async {
|
| // 1 * 2.0
|
| BinaryExpression node = AstTestFactory.binaryExpression(
|
| _resolvedInteger(1), TokenType.PLUS, _resolvedDouble(2.0));
|
| @@ -603,21 +603,21 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBooleanLiteral_false() {
|
| + test_visitBooleanLiteral_false() async {
|
| // false
|
| Expression node = AstTestFactory.booleanLiteral(false);
|
| expect(_analyze(node), same(_typeProvider.boolType));
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitBooleanLiteral_true() {
|
| + test_visitBooleanLiteral_true() async {
|
| // true
|
| Expression node = AstTestFactory.booleanLiteral(true);
|
| expect(_analyze(node), same(_typeProvider.boolType));
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitCascadeExpression() {
|
| + test_visitCascadeExpression() async {
|
| // a..length
|
| Expression node = AstTestFactory.cascadeExpression(
|
| _resolvedString("a"), [AstTestFactory.propertyAccess2(null, "length")]);
|
| @@ -625,7 +625,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitConditionalExpression_differentTypes() {
|
| + test_visitConditionalExpression_differentTypes() async {
|
| // true ? 1.0 : 0
|
| Expression node = AstTestFactory.conditionalExpression(
|
| AstTestFactory.booleanLiteral(true),
|
| @@ -635,7 +635,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitConditionalExpression_sameTypes() {
|
| + test_visitConditionalExpression_sameTypes() async {
|
| // true ? 1 : 0
|
| Expression node = AstTestFactory.conditionalExpression(
|
| AstTestFactory.booleanLiteral(true),
|
| @@ -645,14 +645,14 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitDoubleLiteral() {
|
| + test_visitDoubleLiteral() async {
|
| // 4.33
|
| Expression node = AstTestFactory.doubleLiteral(4.33);
|
| expect(_analyze(node), same(_typeProvider.doubleType));
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_async_block() {
|
| + test_visitFunctionExpression_async_block() async {
|
| // () async {}
|
| BlockFunctionBody body = AstTestFactory.blockFunctionBody2();
|
| body.keyword = TokenFactory.tokenFromString('async');
|
| @@ -664,7 +664,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_async_expression() {
|
| + test_visitFunctionExpression_async_expression() async {
|
| // () async => e, where e has type int
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType futureIntType =
|
| @@ -680,7 +680,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_async_expression_flatten() {
|
| + test_visitFunctionExpression_async_expression_flatten() async {
|
| // () async => e, where e has type Future<int>
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType futureIntType =
|
| @@ -696,7 +696,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_async_expression_flatten_twice() {
|
| + test_visitFunctionExpression_async_expression_flatten_twice() async {
|
| // () async => e, where e has type Future<Future<int>>
|
| InterfaceType intType = _typeProvider.intType;
|
| InterfaceType futureIntType =
|
| @@ -714,7 +714,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_generator_async() {
|
| + test_visitFunctionExpression_generator_async() async {
|
| // () async* {}
|
| BlockFunctionBody body = AstTestFactory.blockFunctionBody2();
|
| body.keyword = TokenFactory.tokenFromString('async');
|
| @@ -727,7 +727,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_generator_sync() {
|
| + test_visitFunctionExpression_generator_sync() async {
|
| // () sync* {}
|
| BlockFunctionBody body = AstTestFactory.blockFunctionBody2();
|
| body.keyword = TokenFactory.tokenFromString('sync');
|
| @@ -740,7 +740,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_named_block() {
|
| + test_visitFunctionExpression_named_block() async {
|
| // ({p1 : 0, p2 : 0}) {}
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p1 = AstTestFactory.namedFormalParameter(
|
| @@ -763,7 +763,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_named_expression() {
|
| + test_visitFunctionExpression_named_expression() async {
|
| // ({p : 0}) -> 0;
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p = AstTestFactory.namedFormalParameter(
|
| @@ -781,7 +781,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_normal_block() {
|
| + test_visitFunctionExpression_normal_block() async {
|
| // (p1, p2) {}
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
|
| @@ -799,7 +799,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_normal_expression() {
|
| + test_visitFunctionExpression_normal_expression() async {
|
| // (p1, p2) -> 0
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p = AstTestFactory.simpleFormalParameter3("p");
|
| @@ -814,7 +814,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_normalAndNamed_block() {
|
| + test_visitFunctionExpression_normalAndNamed_block() async {
|
| // (p1, {p2 : 0}) {}
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
|
| @@ -834,7 +834,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_normalAndNamed_expression() {
|
| + test_visitFunctionExpression_normalAndNamed_expression() async {
|
| // (p1, {p2 : 0}) -> 0
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
|
| @@ -854,7 +854,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_normalAndPositional_block() {
|
| + test_visitFunctionExpression_normalAndPositional_block() async {
|
| // (p1, [p2 = 0]) {}
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
|
| @@ -873,7 +873,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_normalAndPositional_expression() {
|
| + test_visitFunctionExpression_normalAndPositional_expression() async {
|
| // (p1, [p2 = 0]) -> 0
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p1 = AstTestFactory.simpleFormalParameter3("p1");
|
| @@ -892,7 +892,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_positional_block() {
|
| + test_visitFunctionExpression_positional_block() async {
|
| // ([p1 = 0, p2 = 0]) {}
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p1 = AstTestFactory.positionalFormalParameter(
|
| @@ -912,7 +912,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitFunctionExpression_positional_expression() {
|
| + test_visitFunctionExpression_positional_expression() async {
|
| // ([p1 = 0, p2 = 0]) -> 0
|
| DartType dynamicType = _typeProvider.dynamicType;
|
| FormalParameter p = AstTestFactory.positionalFormalParameter(
|
| @@ -928,7 +928,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitIndexExpression_getter() {
|
| + test_visitIndexExpression_getter() async {
|
| // List a;
|
| // a[2]
|
| InterfaceType listType = _typeProvider.listType;
|
| @@ -941,7 +941,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitIndexExpression_setter() {
|
| + test_visitIndexExpression_setter() async {
|
| // List a;
|
| // a[2] = 0
|
| InterfaceType listType = _typeProvider.listType;
|
| @@ -956,7 +956,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitIndexExpression_typeParameters() {
|
| + test_visitIndexExpression_typeParameters() async {
|
| // List<int> list = ...
|
| // list[0]
|
| InterfaceType intType = _typeProvider.intType;
|
| @@ -977,7 +977,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitIndexExpression_typeParameters_inSetterContext() {
|
| + test_visitIndexExpression_typeParameters_inSetterContext() async {
|
| // List<int> list = ...
|
| // list[0] = 0;
|
| InterfaceType intType = _typeProvider.intType;
|
| @@ -1001,7 +1001,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitInstanceCreationExpression_named() {
|
| + test_visitInstanceCreationExpression_named() async {
|
| // new C.m()
|
| ClassElementImpl classElement = ElementFactory.classElement2("C");
|
| String constructorName = "m";
|
| @@ -1018,7 +1018,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitInstanceCreationExpression_typeParameters() {
|
| + test_visitInstanceCreationExpression_typeParameters() async {
|
| // new C<I>()
|
| ClassElementImpl elementC = ElementFactory.classElement2("C", ["E"]);
|
| ClassElementImpl elementI = ElementFactory.classElement2("I");
|
| @@ -1038,7 +1038,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitInstanceCreationExpression_unnamed() {
|
| + test_visitInstanceCreationExpression_unnamed() async {
|
| // new C()
|
| ClassElementImpl classElement = ElementFactory.classElement2("C");
|
| ConstructorElementImpl constructor =
|
| @@ -1052,14 +1052,14 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitIntegerLiteral() {
|
| + test_visitIntegerLiteral() async {
|
| // 42
|
| Expression node = _resolvedInteger(42);
|
| expect(_analyze(node), same(_typeProvider.intType));
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitIsExpression_negated() {
|
| + test_visitIsExpression_negated() async {
|
| // a is! String
|
| Expression node = AstTestFactory.isExpression(
|
| _resolvedString("a"), true, AstTestFactory.typeName4("String"));
|
| @@ -1067,7 +1067,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitIsExpression_notNegated() {
|
| + test_visitIsExpression_notNegated() async {
|
| // a is String
|
| Expression node = AstTestFactory.isExpression(
|
| _resolvedString("a"), false, AstTestFactory.typeName4("String"));
|
| @@ -1075,7 +1075,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitListLiteral_empty() {
|
| + test_visitListLiteral_empty() async {
|
| // []
|
| Expression node = AstTestFactory.listLiteral();
|
| DartType resultType = _analyze(node);
|
| @@ -1086,7 +1086,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitListLiteral_nonEmpty() {
|
| + test_visitListLiteral_nonEmpty() async {
|
| // [0]
|
| Expression node = AstTestFactory.listLiteral([_resolvedInteger(0)]);
|
| DartType resultType = _analyze(node);
|
| @@ -1097,7 +1097,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitListLiteral_unresolved() {
|
| + test_visitListLiteral_unresolved() async {
|
| _analyzer = _createAnalyzer(strongMode: true);
|
| // [a] // where 'a' is not resolved
|
| Identifier identifier = AstTestFactory.identifier3('a');
|
| @@ -1110,7 +1110,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitListLiteral_unresolved_multiple() {
|
| + test_visitListLiteral_unresolved_multiple() async {
|
| _analyzer = _createAnalyzer(strongMode: true);
|
| // [0, a, 1] // where 'a' is not resolved
|
| Identifier identifier = AstTestFactory.identifier3('a');
|
| @@ -1123,7 +1123,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitMapLiteral_empty() {
|
| + test_visitMapLiteral_empty() async {
|
| // {}
|
| Expression node = AstTestFactory.mapLiteral2();
|
| DartType resultType = _analyze(node);
|
| @@ -1134,7 +1134,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitMapLiteral_nonEmpty() {
|
| + test_visitMapLiteral_nonEmpty() async {
|
| // {"k" : 0}
|
| Expression node = AstTestFactory.mapLiteral2(
|
| [AstTestFactory.mapLiteralEntry("k", _resolvedInteger(0))]);
|
| @@ -1146,14 +1146,14 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitMethodInvocation_then() {
|
| + test_visitMethodInvocation_then() async {
|
| // then()
|
| Expression node = AstTestFactory.methodInvocation(null, "then");
|
| _analyze(node);
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitNamedExpression() {
|
| + test_visitNamedExpression() async {
|
| // n: a
|
| Expression node =
|
| AstTestFactory.namedExpression2("n", _resolvedString("a"));
|
| @@ -1161,14 +1161,14 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitNullLiteral() {
|
| + test_visitNullLiteral() async {
|
| // null
|
| Expression node = AstTestFactory.nullLiteral();
|
| expect(_analyze(node), same(_typeProvider.bottomType));
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitParenthesizedExpression() {
|
| + test_visitParenthesizedExpression() async {
|
| // (0)
|
| Expression node =
|
| AstTestFactory.parenthesizedExpression(_resolvedInteger(0));
|
| @@ -1176,7 +1176,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPostfixExpression_minusMinus() {
|
| + test_visitPostfixExpression_minusMinus() async {
|
| // 0--
|
| PostfixExpression node = AstTestFactory.postfixExpression(
|
| _resolvedInteger(0), TokenType.MINUS_MINUS);
|
| @@ -1184,7 +1184,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPostfixExpression_plusPlus() {
|
| + test_visitPostfixExpression_plusPlus() async {
|
| // 0++
|
| PostfixExpression node = AstTestFactory.postfixExpression(
|
| _resolvedInteger(0), TokenType.PLUS_PLUS);
|
| @@ -1192,7 +1192,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixedIdentifier_getter() {
|
| + test_visitPrefixedIdentifier_getter() async {
|
| DartType boolType = _typeProvider.boolType;
|
| PropertyAccessorElementImpl getter =
|
| ElementFactory.getterElement("b", false, boolType);
|
| @@ -1202,7 +1202,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixedIdentifier_setter() {
|
| + test_visitPrefixedIdentifier_setter() async {
|
| DartType boolType = _typeProvider.boolType;
|
| FieldElementImpl field =
|
| ElementFactory.fieldElement("b", false, false, false, boolType);
|
| @@ -1213,7 +1213,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixedIdentifier_variable() {
|
| + test_visitPrefixedIdentifier_variable() async {
|
| VariableElementImpl variable = ElementFactory.localVariableElement2("b");
|
| variable.type = _typeProvider.boolType;
|
| PrefixedIdentifier node = AstTestFactory.identifier5("a", "b");
|
| @@ -1222,7 +1222,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixExpression_bang() {
|
| + test_visitPrefixExpression_bang() async {
|
| // !0
|
| PrefixExpression node =
|
| AstTestFactory.prefixExpression(TokenType.BANG, _resolvedInteger(0));
|
| @@ -1230,7 +1230,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixExpression_minus() {
|
| + test_visitPrefixExpression_minus() async {
|
| // -0
|
| PrefixExpression node =
|
| AstTestFactory.prefixExpression(TokenType.MINUS, _resolvedInteger(0));
|
| @@ -1240,7 +1240,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixExpression_minusMinus() {
|
| + test_visitPrefixExpression_minusMinus() async {
|
| // --0
|
| PrefixExpression node = AstTestFactory.prefixExpression(
|
| TokenType.MINUS_MINUS, _resolvedInteger(0));
|
| @@ -1250,7 +1250,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixExpression_not() {
|
| + test_visitPrefixExpression_not() async {
|
| // !true
|
| Expression node = AstTestFactory.prefixExpression(
|
| TokenType.BANG, AstTestFactory.booleanLiteral(true));
|
| @@ -1258,7 +1258,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixExpression_plusPlus() {
|
| + test_visitPrefixExpression_plusPlus() async {
|
| // ++0
|
| PrefixExpression node = AstTestFactory.prefixExpression(
|
| TokenType.PLUS_PLUS, _resolvedInteger(0));
|
| @@ -1268,7 +1268,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPrefixExpression_tilde() {
|
| + test_visitPrefixExpression_tilde() async {
|
| // ~0
|
| PrefixExpression node =
|
| AstTestFactory.prefixExpression(TokenType.TILDE, _resolvedInteger(0));
|
| @@ -1278,7 +1278,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPropertyAccess_propagated_getter() {
|
| + test_visitPropertyAccess_propagated_getter() async {
|
| DartType boolType = _typeProvider.boolType;
|
| PropertyAccessorElementImpl getter =
|
| ElementFactory.getterElement("b", false, boolType);
|
| @@ -1289,7 +1289,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPropertyAccess_propagated_setter() {
|
| + test_visitPropertyAccess_propagated_setter() async {
|
| DartType boolType = _typeProvider.boolType;
|
| FieldElementImpl field =
|
| ElementFactory.fieldElement("b", false, false, false, boolType);
|
| @@ -1301,7 +1301,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPropertyAccess_static_getter() {
|
| + test_visitPropertyAccess_static_getter() async {
|
| DartType boolType = _typeProvider.boolType;
|
| PropertyAccessorElementImpl getter =
|
| ElementFactory.getterElement("b", false, boolType);
|
| @@ -1312,7 +1312,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitPropertyAccess_static_setter() {
|
| + test_visitPropertyAccess_static_setter() async {
|
| DartType boolType = _typeProvider.boolType;
|
| FieldElementImpl field =
|
| ElementFactory.fieldElement("b", false, false, false, boolType);
|
| @@ -1324,7 +1324,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitSimpleIdentifier_dynamic() {
|
| + test_visitSimpleIdentifier_dynamic() async {
|
| // "dynamic"
|
| SimpleIdentifier identifier = AstTestFactory.identifier3('dynamic');
|
| DynamicElementImpl element = DynamicElementImpl.instance;
|
| @@ -1334,14 +1334,14 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitSimpleStringLiteral() {
|
| + test_visitSimpleStringLiteral() async {
|
| // "a"
|
| Expression node = _resolvedString("a");
|
| expect(_analyze(node), same(_typeProvider.stringType));
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitStringInterpolation() {
|
| + test_visitStringInterpolation() async {
|
| // "a${'b'}c"
|
| Expression node = AstTestFactory.string([
|
| AstTestFactory.interpolationString("a", "a"),
|
| @@ -1352,7 +1352,7 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitSuperExpression() {
|
| + test_visitSuperExpression() async {
|
| // super
|
| InterfaceType superType = ElementFactory.classElement2("A").type;
|
| InterfaceType thisType = ElementFactory.classElement("B", superType).type;
|
| @@ -1361,12 +1361,12 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitSymbolLiteral() {
|
| + test_visitSymbolLiteral() async {
|
| expect(_analyze(AstTestFactory.symbolLiteral(["a"])),
|
| same(_typeProvider.symbolType));
|
| }
|
|
|
| - void test_visitThisExpression() {
|
| + test_visitThisExpression() async {
|
| // this
|
| InterfaceType thisType = ElementFactory
|
| .classElement("B", ElementFactory.classElement2("A").type)
|
| @@ -1376,14 +1376,14 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitThrowExpression_withoutValue() {
|
| + test_visitThrowExpression_withoutValue() async {
|
| // throw
|
| Expression node = AstTestFactory.throwExpression();
|
| expect(_analyze(node), same(_typeProvider.bottomType));
|
| _listener.assertNoErrors();
|
| }
|
|
|
| - void test_visitThrowExpression_withValue() {
|
| + test_visitThrowExpression_withValue() async {
|
| // throw 0
|
| Expression node = AstTestFactory.throwExpression2(_resolvedInteger(0));
|
| expect(_analyze(node), same(_typeProvider.bottomType));
|
|
|