| Index: pkg/analyzer/test/generated/all_the_rest_test.dart
|
| diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
|
| index 767f2c3eba03ae273a35d6544a26fd31a000e6e2..6f3aa5dbbf11eff9dc971b1eb06ebdd86e27336a 100644
|
| --- a/pkg/analyzer/test/generated/all_the_rest_test.dart
|
| +++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
|
| @@ -4,10 +4,12 @@
|
|
|
| library analyzer.test.generated.all_the_rest_test;
|
|
|
| +import 'package:analyzer/dart/element/element.dart';
|
| +import 'package:analyzer/dart/element/type.dart';
|
| import 'package:analyzer/file_system/physical_file_system.dart';
|
| +import 'package:analyzer/src/dart/element/element.dart';
|
| import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
|
| import 'package:analyzer/src/generated/constant.dart';
|
| -import 'package:analyzer/src/generated/element.dart';
|
| import 'package:analyzer/src/generated/engine.dart';
|
| import 'package:analyzer/src/generated/error.dart';
|
| import 'package:analyzer/src/generated/java_core.dart';
|
| @@ -573,19 +575,22 @@ class ConstantFinderTest {
|
| expect(_findConstants(), contains(field.element));
|
| }
|
|
|
| - void test_visitVariableDeclaration_static_const_inClassWithConstConstructor() {
|
| + void
|
| + test_visitVariableDeclaration_static_const_inClassWithConstConstructor() {
|
| VariableDeclaration field = _setupFieldDeclaration('C', 'f', Keyword.CONST,
|
| isStatic: true, hasConstConstructor: true);
|
| expect(_findConstants(), contains(field.element));
|
| }
|
|
|
| - void test_visitVariableDeclaration_static_final_inClassWithConstConstructor() {
|
| + void
|
| + test_visitVariableDeclaration_static_final_inClassWithConstConstructor() {
|
| VariableDeclaration field = _setupFieldDeclaration('C', 'f', Keyword.FINAL,
|
| isStatic: true, hasConstConstructor: true);
|
| expect(_findConstants(), isNot(contains(field.element)));
|
| }
|
|
|
| - void test_visitVariableDeclaration_uninitialized_final_inClassWithConstConstructor() {
|
| + void
|
| + test_visitVariableDeclaration_uninitialized_final_inClassWithConstConstructor() {
|
| VariableDeclaration field = _setupFieldDeclaration('C', 'f', Keyword.FINAL,
|
| isInitialized: false, hasConstConstructor: true);
|
| expect(_findConstants(), isNot(contains(field.element)));
|
| @@ -619,8 +624,8 @@ class ConstantFinderTest {
|
|
|
| ConstructorElement _setupConstructorDeclaration(String name, bool isConst) {
|
| Keyword constKeyword = isConst ? Keyword.CONST : null;
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration2(
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration2(
|
| constKeyword,
|
| null,
|
| null,
|
| @@ -661,8 +666,8 @@ class ConstantFinderTest {
|
| classElement.fields = <FieldElement>[fieldElement];
|
| classDeclaration.name.staticElement = classElement;
|
| if (hasConstConstructor) {
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration2(
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration2(
|
| Keyword.CONST,
|
| null,
|
| AstFactory.identifier3(className),
|
| @@ -1327,19 +1332,23 @@ class A {
|
| _assertIntField(fields, "k", 13);
|
| }
|
|
|
| - void test_instanceCreationExpression_computedField_namedOptionalWithDefault() {
|
| + void
|
| + test_instanceCreationExpression_computedField_namedOptionalWithDefault() {
|
| _checkInstanceCreationOptionalParams(false, true, true);
|
| }
|
|
|
| - void test_instanceCreationExpression_computedField_namedOptionalWithoutDefault() {
|
| + void
|
| + test_instanceCreationExpression_computedField_namedOptionalWithoutDefault() {
|
| _checkInstanceCreationOptionalParams(false, true, false);
|
| }
|
|
|
| - void test_instanceCreationExpression_computedField_unnamedOptionalWithDefault() {
|
| + void
|
| + test_instanceCreationExpression_computedField_unnamedOptionalWithDefault() {
|
| _checkInstanceCreationOptionalParams(false, false, true);
|
| }
|
|
|
| - void test_instanceCreationExpression_computedField_unnamedOptionalWithoutDefault() {
|
| + void
|
| + test_instanceCreationExpression_computedField_unnamedOptionalWithoutDefault() {
|
| _checkInstanceCreationOptionalParams(false, false, false);
|
| }
|
|
|
| @@ -1432,19 +1441,23 @@ class A {
|
| _assertIntField(fields, "x", 42);
|
| }
|
|
|
| - void test_instanceCreationExpression_fieldFormalParameter_namedOptionalWithDefault() {
|
| + void
|
| + test_instanceCreationExpression_fieldFormalParameter_namedOptionalWithDefault() {
|
| _checkInstanceCreationOptionalParams(true, true, true);
|
| }
|
|
|
| - void test_instanceCreationExpression_fieldFormalParameter_namedOptionalWithoutDefault() {
|
| + void
|
| + test_instanceCreationExpression_fieldFormalParameter_namedOptionalWithoutDefault() {
|
| _checkInstanceCreationOptionalParams(true, true, false);
|
| }
|
|
|
| - void test_instanceCreationExpression_fieldFormalParameter_unnamedOptionalWithDefault() {
|
| + void
|
| + test_instanceCreationExpression_fieldFormalParameter_unnamedOptionalWithDefault() {
|
| _checkInstanceCreationOptionalParams(true, false, true);
|
| }
|
|
|
| - void test_instanceCreationExpression_fieldFormalParameter_unnamedOptionalWithoutDefault() {
|
| + void
|
| + test_instanceCreationExpression_fieldFormalParameter_unnamedOptionalWithoutDefault() {
|
| _checkInstanceCreationOptionalParams(true, false, false);
|
| }
|
|
|
| @@ -4851,8 +4864,8 @@ class ElementBuilderTest extends EngineTestCase {
|
| ElementHolder holder = new ElementHolder();
|
| ElementBuilder builder = new ElementBuilder(holder);
|
| String className = "A";
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration2(
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration2(
|
| null,
|
| null,
|
| AstFactory.identifier3(className),
|
| @@ -4880,8 +4893,8 @@ class ElementBuilderTest extends EngineTestCase {
|
| ElementHolder holder = new ElementHolder();
|
| ElementBuilder builder = new ElementBuilder(holder);
|
| String className = "A";
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration2(
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration2(
|
| null,
|
| Keyword.FACTORY,
|
| AstFactory.identifier3(className),
|
| @@ -4907,8 +4920,8 @@ class ElementBuilderTest extends EngineTestCase {
|
| ElementHolder holder = new ElementHolder();
|
| ElementBuilder builder = new ElementBuilder(holder);
|
| String className = "A";
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration2(
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration2(
|
| null,
|
| null,
|
| AstFactory.identifier3(className),
|
| @@ -4940,8 +4953,8 @@ class ElementBuilderTest extends EngineTestCase {
|
| ElementBuilder builder = new ElementBuilder(holder);
|
| String className = "A";
|
| String constructorName = "c";
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration2(
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration2(
|
| null,
|
| null,
|
| AstFactory.identifier3(className),
|
| @@ -4969,8 +4982,8 @@ class ElementBuilderTest extends EngineTestCase {
|
| ElementHolder holder = new ElementHolder();
|
| ElementBuilder builder = new ElementBuilder(holder);
|
| String className = "A";
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration2(
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration2(
|
| null,
|
| null,
|
| AstFactory.identifier3(className),
|
| @@ -5050,8 +5063,8 @@ class ElementBuilderTest extends EngineTestCase {
|
| ElementHolder holder = new ElementHolder();
|
| ElementBuilder builder = new ElementBuilder(holder);
|
| String parameterName = 'p';
|
| - DefaultFormalParameter formalParameter = AstFactory
|
| - .positionalFormalParameter(
|
| + DefaultFormalParameter formalParameter =
|
| + AstFactory.positionalFormalParameter(
|
| AstFactory.simpleFormalParameter3(parameterName),
|
| AstFactory.integer(0));
|
| formalParameter.accept(builder);
|
| @@ -6455,7 +6468,8 @@ class A {
|
| (obj) => obj is FunctionElement, FunctionElement, element);
|
| }
|
|
|
| - void test_locate_Identifier_annotationClass_namedConstructor_forSimpleFormalParameter() {
|
| + void
|
| + test_locate_Identifier_annotationClass_namedConstructor_forSimpleFormalParameter() {
|
| AstNode id = _findNodeIndexedIn(
|
| "Class",
|
| 2,
|
| @@ -6470,7 +6484,8 @@ void main(@Class.name() parameter) {
|
| (obj) => obj is ClassElement, ClassElement, element);
|
| }
|
|
|
| - void test_locate_Identifier_annotationClass_unnamedConstructor_forSimpleFormalParameter() {
|
| + void
|
| + test_locate_Identifier_annotationClass_unnamedConstructor_forSimpleFormalParameter() {
|
| AstNode id = _findNodeIndexedIn(
|
| "Class",
|
| 2,
|
| @@ -6577,8 +6592,8 @@ void main() {
|
| SimpleIdentifier identifier = AstFactory.identifier3("A");
|
| PrefixedIdentifier prefixedIdentifier =
|
| AstFactory.identifier4("pref", identifier);
|
| - InstanceCreationExpression creation = AstFactory
|
| - .instanceCreationExpression2(
|
| + InstanceCreationExpression creation =
|
| + AstFactory.instanceCreationExpression2(
|
| Keyword.NEW, AstFactory.typeName3(prefixedIdentifier));
|
| // set ClassElement
|
| ClassElement classElement = ElementFactory.classElement2("A");
|
| @@ -6595,8 +6610,8 @@ void main() {
|
| void test_locate_InstanceCreationExpression_type_simpleIdentifier() {
|
| // prepare: new A()
|
| SimpleIdentifier identifier = AstFactory.identifier3("A");
|
| - InstanceCreationExpression creation = AstFactory
|
| - .instanceCreationExpression2(
|
| + InstanceCreationExpression creation =
|
| + AstFactory.instanceCreationExpression2(
|
| Keyword.NEW, AstFactory.typeName3(identifier));
|
| // set ClassElement
|
| ClassElement classElement = ElementFactory.classElement2("A");
|
| @@ -8101,8 +8116,8 @@ class ReferenceFinderTest {
|
| String name, bool isConst) {
|
| List<ConstructorInitializer> initializers =
|
| new List<ConstructorInitializer>();
|
| - ConstructorDeclaration constructorDeclaration = AstFactory
|
| - .constructorDeclaration(AstFactory.identifier3(name), null,
|
| + ConstructorDeclaration constructorDeclaration =
|
| + AstFactory.constructorDeclaration(AstFactory.identifier3(name), null,
|
| AstFactory.formalParameterList(), initializers);
|
| if (isConst) {
|
| constructorDeclaration.constKeyword = new KeywordToken(Keyword.CONST, 0);
|
|
|