| Index: pkg/analyzer/test/generated/resolver_test.dart
|
| diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
|
| index fa4338d94762abdcea34eb0a568bf1fa1ddbd028..5f9e99b93b6c5f39e80ddde3f37005c0afd1b0c3 100644
|
| --- a/pkg/analyzer/test/generated/resolver_test.dart
|
| +++ b/pkg/analyzer/test/generated/resolver_test.dart
|
| @@ -197,8 +197,8 @@ class AnalysisContextFactory {
|
| 'onValue', futureThenR, [futureElement.typeParameters[0]], null);
|
|
|
| DartType futureRType = futureElement.type.substitute4([futureThenR.type]);
|
| - MethodElementImpl thenMethod = ElementFactory
|
| - .methodElementWithParameters(futureElement, "then", futureRType, [
|
| + MethodElementImpl thenMethod = ElementFactory.methodElementWithParameters(
|
| + futureElement, "then", futureRType, [
|
| ElementFactory.requiredParameter2("onValue", thenOnValue.type),
|
| ElementFactory.namedParameter2("onError", provider.functionType)
|
| ]);
|
| @@ -249,7 +249,8 @@ class AnalysisContextFactory {
|
| asyncUnit.types = <ClassElement>[
|
| completerElement,
|
| futureElement,
|
| - streamElement
|
| + streamElement,
|
| + streamSubscriptionElement
|
| ];
|
| LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode(
|
| coreContext, AstFactory.libraryIdentifier2(["dart", "async"]));
|
| @@ -286,8 +287,8 @@ class AnalysisContextFactory {
|
| ClassElementImpl htmlDocumentElement =
|
| ElementFactory.classElement("HtmlDocument", documentElement.type);
|
| htmlDocumentElement.methods = <MethodElement>[
|
| - ElementFactory
|
| - .methodElement("query", elementType, <DartType>[provider.stringType])
|
| + ElementFactory.methodElement(
|
| + "query", elementType, <DartType>[provider.stringType])
|
| ];
|
| htmlUnit.types = <ClassElement>[
|
| ElementFactory.classElement("AnchorElement", elementType),
|
| @@ -307,8 +308,8 @@ class AnalysisContextFactory {
|
| ElementFactory.functionElement3("query", elementElement,
|
| <ClassElement>[provider.stringType.element], ClassElement.EMPTY_LIST)
|
| ];
|
| - TopLevelVariableElementImpl document =
|
| - ElementFactory.topLevelVariableElement3(
|
| + TopLevelVariableElementImpl document = ElementFactory
|
| + .topLevelVariableElement3(
|
| "document", false, true, htmlDocumentElement.type);
|
| htmlUnit.topLevelVariables = <TopLevelVariableElement>[document];
|
| htmlUnit.accessors = <PropertyAccessorElement>[document.getter];
|
| @@ -5107,8 +5108,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classA);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_getter_method() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_getter_method() {
|
| // class I1 { int m(); }
|
| // class I2 { int get m; }
|
| // class A implements I2, I1 {}
|
| @@ -5131,8 +5131,7 @@ class InheritanceManagerTest {
|
| [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_int_str() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_int_str() {
|
| // class I1 { int m(); }
|
| // class I2 { String m(); }
|
| // class A implements I1, I2 {}
|
| @@ -5142,8 +5141,8 @@ class InheritanceManagerTest {
|
| ElementFactory.methodElement(methodName, null, [_typeProvider.intType]);
|
| classI1.methods = <MethodElement>[methodM1];
|
| ClassElementImpl classI2 = ElementFactory.classElement2("I2");
|
| - MethodElement methodM2 = ElementFactory
|
| - .methodElement(methodName, null, [_typeProvider.stringType]);
|
| + MethodElement methodM2 = ElementFactory.methodElement(
|
| + methodName, null, [_typeProvider.stringType]);
|
| classI2.methods = <MethodElement>[methodM2];
|
| ClassElementImpl classA = ElementFactory.classElement2("A");
|
| classA.interfaces = <InterfaceType>[classI1.type, classI2.type];
|
| @@ -5155,8 +5154,7 @@ class InheritanceManagerTest {
|
| classA, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_method_getter() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_method_getter() {
|
| // class I1 { int m(); }
|
| // class I2 { int get m; }
|
| // class A implements I1, I2 {}
|
| @@ -5179,8 +5177,7 @@ class InheritanceManagerTest {
|
| [StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD]);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_numOfRequiredParams() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_numOfRequiredParams() {
|
| // class I1 { dynamic m(int, [int]); }
|
| // class I2 { dynamic m(int, int, int); }
|
| // class A implements I1, I2 {}
|
| @@ -5229,15 +5226,14 @@ class InheritanceManagerTest {
|
| classA, [StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE]);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_str_int() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_str_int() {
|
| // class I1 { int m(); }
|
| // class I2 { String m(); }
|
| // class A implements I2, I1 {}
|
| ClassElementImpl classI1 = ElementFactory.classElement2("I1");
|
| String methodName = "m";
|
| - MethodElement methodM1 = ElementFactory
|
| - .methodElement(methodName, null, [_typeProvider.stringType]);
|
| + MethodElement methodM1 = ElementFactory.methodElement(
|
| + methodName, null, [_typeProvider.stringType]);
|
| classI1.methods = <MethodElement>[methodM1];
|
| ClassElementImpl classI2 = ElementFactory.classElement2("I2");
|
| MethodElement methodM2 =
|
| @@ -5339,8 +5335,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classA);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_getters() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_getters() {
|
| // class I1 { int get g; }
|
| // class I2 { num get g; }
|
| // class A implements I1, I2 {}
|
| @@ -5364,8 +5359,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classA);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_methods() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_methods() {
|
| // class I1 { dynamic m(int); }
|
| // class I2 { dynamic m(num); }
|
| // class A implements I1, I2 {}
|
| @@ -5399,8 +5393,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classA);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_setters() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_setters() {
|
| // class I1 { set s(int); }
|
| // class I2 { set s(num); }
|
| // class A implements I1, I2 {}
|
| @@ -5425,8 +5418,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classA);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_getters() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_getters() {
|
| // class A {}
|
| // class B extends A {}
|
| // class C extends B {}
|
| @@ -5465,8 +5457,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classD);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_methods() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_methods() {
|
| // class A {}
|
| // class B extends A {}
|
| // class C extends B {}
|
| @@ -5520,8 +5511,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classD);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_setters() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_3_setters() {
|
| // class A {}
|
| // class B extends A {}
|
| // class C extends B {}
|
| @@ -5561,8 +5551,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classD);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_2_methods() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_2_methods() {
|
| // class I1 { int m(); }
|
| // class I2 { int m([int]); }
|
| // class A implements I1, I2 {}
|
| @@ -5589,8 +5578,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classA);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_3_methods() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_3_methods() {
|
| // class I1 { int m(); }
|
| // class I2 { int m([int]); }
|
| // class I3 { int m([int, int]); }
|
| @@ -5635,8 +5623,7 @@ class InheritanceManagerTest {
|
| _assertNoErrors(classA);
|
| }
|
|
|
| - void
|
| - test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_4_methods() {
|
| + void test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_4_methods() {
|
| // class I1 { int m(); }
|
| // class I2 { int m(); }
|
| // class I3 { int m([int]); }
|
| @@ -9338,9 +9325,7 @@ const A = null;
|
| expect(declarations, hasLength(2));
|
| Element expectedElement = (declarations[0] as TopLevelVariableDeclaration)
|
| .variables
|
| - .variables[0]
|
| - .name
|
| - .staticElement;
|
| + .variables[0].name.staticElement;
|
| EngineTestCase.assertInstanceOf((obj) => obj is PropertyInducingElement,
|
| PropertyInducingElement, expectedElement);
|
| expectedElement = (expectedElement as PropertyInducingElement).getter;
|
| @@ -9531,9 +9516,7 @@ const A = null;
|
| expect(declarations, hasLength(2));
|
| Element expectedElement = (declarations[0] as TopLevelVariableDeclaration)
|
| .variables
|
| - .variables[0]
|
| - .name
|
| - .staticElement;
|
| + .variables[0].name.staticElement;
|
| EngineTestCase.assertInstanceOf((obj) => obj is PropertyInducingElement,
|
| PropertyInducingElement, expectedElement);
|
| expectedElement = (expectedElement as PropertyInducingElement).getter;
|
| @@ -11756,17 +11739,17 @@ class StrongModeDownwardsInferenceTest extends ResolverTestCase {
|
| TypeAssertions _assertions;
|
| AsserterBuilder<Element, DartType> _hasElement;
|
| AsserterBuilder<DartType, DartType> _isType;
|
| - AsserterBuilder2<Asserter<DartType>, Asserter<DartType>, DartType>
|
| - _isFunction2Of;
|
| - AsserterBuilderBuilder<Asserter<DartType>, List<Asserter<DartType>>, DartType>
|
| - _isInstantiationOf;
|
| + AsserterBuilder2<Asserter<DartType>, Asserter<DartType>,
|
| + DartType> _isFunction2Of;
|
| + AsserterBuilderBuilder<Asserter<DartType>, List<Asserter<DartType>>,
|
| + DartType> _isInstantiationOf;
|
| Asserter<DartType> _isInt;
|
| Asserter<DartType> _isNum;
|
| Asserter<DartType> _isString;
|
| Asserter<DartType> _isDynamic;
|
| AsserterBuilder<Asserter<DartType>, InterfaceType> _isListOf;
|
| - AsserterBuilder2<Asserter<DartType>, Asserter<DartType>, InterfaceType>
|
| - _isMapOf;
|
| + AsserterBuilder2<Asserter<DartType>, Asserter<DartType>,
|
| + InterfaceType> _isMapOf;
|
|
|
| @override
|
| void setUp() {
|
| @@ -13997,8 +13980,7 @@ class B extends A {
|
| code, typeProvider.dynamicType, typeProvider.intType);
|
| }
|
|
|
| - void
|
| - test_finalPropertyInducingVariable_classMember_instance_propagatedTarget() {
|
| + void test_finalPropertyInducingVariable_classMember_instance_propagatedTarget() {
|
| addNamedSource(
|
| "/lib.dart",
|
| r'''
|
| @@ -14217,8 +14199,7 @@ f(MyMap<int, String> m) {
|
| expect(vParameter.identifier.propagatedType, same(stringType));
|
| }
|
|
|
| - void
|
| - test_functionExpression_asInvocationArgument_functionExpressionInvocation() {
|
| + void test_functionExpression_asInvocationArgument_functionExpressionInvocation() {
|
| String code = r'''
|
| main() {
|
| (f(String value)) {} ((v) {
|
|
|