Skip to content

Commit 8020e36

Browse files
fshcheglovCommit Queue
authored andcommitted
Rename XyzElementImpl2 to XyzElementImpl.
Change-Id: Id88c171a3cd11a478521fe5c0aefaa8767dfcec6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434743 Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 1fac08e commit 8020e36

File tree

118 files changed

+1082
-1089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1082
-1089
lines changed

pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class DeclarationHelper {
568568
/// containing the [node] that can be referenced as a super parameter.
569569
void addParametersFromSuperConstructor(SuperFormalParameter node) {
570570
var element = node.declaredFragment?.element;
571-
if (element is! SuperFormalParameterElementImpl2) {
571+
if (element is! SuperFormalParameterElementImpl) {
572572
return;
573573
}
574574

@@ -578,7 +578,7 @@ class DeclarationHelper {
578578
}
579579

580580
var constructorElement = constructor.declaredFragment?.element;
581-
if (constructorElement is! ConstructorElementImpl2) {
581+
if (constructorElement is! ConstructorElementImpl) {
582582
return;
583583
}
584584

pkg/analysis_server/test/plugin/protocol_dart_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class A {
131131
}
132132

133133
void test_dynamic() {
134-
var engineElement = engine.DynamicElementImpl2.instance;
134+
var engineElement = engine.DynamicElementImpl.instance;
135135
// create notification Element
136136
var element = convertElement(engineElement);
137137
expect(element.kind, ElementKind.UNKNOWN);

pkg/analysis_server/test/services/refactoring/agnostic/change_method_signature_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class AbstractChangeMethodSignatureTest extends AbstractContextTest {
117117
String _elementToReferenceString(Element element) {
118118
var enclosingElement = element.enclosingElement;
119119
var reference = switch (element) {
120-
ElementImpl2() =>
120+
ElementImpl() =>
121121
element.reference ?? (element.firstFragment as FragmentImpl).reference,
122122
_ => null,
123123
};

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import 'package:meta/meta.dart';
6767

6868
/// This function is used to test recording requirements during analysis.
6969
///
70-
/// Some [ElementImpl2] APIs are not trivial, or maybe even impossible, to
70+
/// Some [ElementImpl] APIs are not trivial, or maybe even impossible, to
7171
/// trigger. For example because this API is not used during normal resolution
7272
/// of Dart code, but can be used by a linter rule.
7373
@visibleForTesting

pkg/analyzer/lib/src/dart/analysis/index.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,15 @@ class _IndexAssembler {
374374

375375
/// Adds a prefix (or empty string for unprefixed) for an element.
376376
void addPrefixForElement(Element element, {PrefixElement? prefix}) {
377-
if (element is MultiplyDefinedElementImpl2 ||
377+
if (element is MultiplyDefinedElementImpl ||
378378
// TODO(brianwilkerson): The last two conditions are here because the
379379
// elements for `dynamic` and `Never` are singletons and hence don't have
380380
// a parent element for which we can find an `_ElementInfo`. This means
381381
// that any reference to either type via a prefix can't be stored in the
382382
// index. The solution is to make those elements be normal (not unique)
383383
// elements.
384-
element is DynamicElementImpl2 ||
385-
element is NeverElementImpl2) {
384+
element is DynamicElementImpl ||
385+
element is NeverElementImpl) {
386386
return;
387387
}
388388

@@ -734,7 +734,7 @@ class _IndexContributor extends GeneralizingAstVisitor {
734734
// implicitly invokes the default super constructor. Associate the
735735
// invocation with the name of the class.
736736
var defaultConstructor = declaredElement.constructors.singleOrNull;
737-
if (defaultConstructor is ConstructorElementImpl2 &&
737+
if (defaultConstructor is ConstructorElementImpl &&
738738
defaultConstructor.isSynthetic) {
739739
defaultConstructor.isDefaultConstructor;
740740
var superConstructor = defaultConstructor.superConstructor2;
@@ -1260,7 +1260,7 @@ class _IndexContributor extends GeneralizingAstVisitor {
12601260
@override
12611261
visitSuperFormalParameter(SuperFormalParameter node) {
12621262
var element = node.declaredFragment!.element;
1263-
if (element is SuperFormalParameterElementImpl2) {
1263+
if (element is SuperFormalParameterElementImpl) {
12641264
var superParameter = element.superConstructorParameter2;
12651265
if (superParameter != null) {
12661266
recordRelation(
@@ -1377,9 +1377,9 @@ class _IndexContributor extends GeneralizingAstVisitor {
13771377
ConstructorElement? constructor,
13781378
) {
13791379
var seenConstructors = <ConstructorElement?>{};
1380-
while (constructor is ConstructorElementImpl2 && constructor.isSynthetic) {
1380+
while (constructor is ConstructorElementImpl && constructor.isSynthetic) {
13811381
var enclosing = constructor.enclosingElement;
1382-
if (enclosing is ClassElementImpl2 && enclosing.isMixinApplication) {
1382+
if (enclosing is ClassElementImpl && enclosing.isMixinApplication) {
13831383
var superInvocation =
13841384
constructor.firstFragment.constantInitializers
13851385
.whereType<SuperConstructorInvocation>()

pkg/analyzer/lib/src/dart/analysis/search.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ class Search {
417417
return _searchReferences_Local(element, (n) => n is Block, searchedFiles);
418418
} else if (element is ExecutableElement) {
419419
return _searchReferences_Function(element, searchedFiles);
420-
} else if (element is PatternVariableElementImpl2) {
420+
} else if (element is PatternVariableElementImpl) {
421421
return _searchReferences_PatternVariable(element, searchedFiles);
422422
} else if (kind == ElementKind.LABEL ||
423423
kind == ElementKind.LOCAL_VARIABLE) {
@@ -436,7 +436,7 @@ class Search {
436436
return _searchReferences_Library(element, searchedFiles);
437437
} else if (element is FormalParameterElement) {
438438
return _searchReferences_Parameter(element, searchedFiles);
439-
} else if (element is PrefixElementImpl2) {
439+
} else if (element is PrefixElementImpl) {
440440
return _searchReferences_Prefix(element, searchedFiles);
441441
} else if (element is TypeParameterElement) {
442442
return _searchReferences_Local(
@@ -953,7 +953,7 @@ class Search {
953953
}
954954

955955
Future<List<SearchResult>> _searchReferences_PatternVariable(
956-
PatternVariableElementImpl2 element,
956+
PatternVariableElementImpl element,
957957
SearchedFiles searchedFiles,
958958
) async {
959959
String path = element.firstFragment.libraryFragment.source.fullName;
@@ -963,14 +963,14 @@ class Search {
963963

964964
var rootVariable = element.rootVariable;
965965
var transitiveVariables =
966-
rootVariable is JoinPatternVariableElementImpl2
966+
rootVariable is JoinPatternVariableElementImpl
967967
? rootVariable.transitiveVariables
968968
: [rootVariable];
969969

970970
// Prepare a binding element for the variable.
971971
var bindElement =
972972
transitiveVariables
973-
.whereType<BindPatternVariableElementImpl2>()
973+
.whereType<BindPatternVariableElementImpl>()
974974
.firstOrNull;
975975
if (bindElement == null) {
976976
return const <SearchResult>[];
@@ -994,7 +994,7 @@ class Search {
994994
}
995995

996996
Future<List<SearchResult>> _searchReferences_Prefix(
997-
PrefixElementImpl2 element,
997+
PrefixElementImpl element,
998998
SearchedFiles searchedFiles,
999999
) async {
10001000
String path = element.firstFragment.libraryFragment.source.fullName;

pkg/analyzer/lib/src/dart/ast/ast.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ final class AssignedVariablePatternImpl extends VariablePatternImpl
10581058
@override
10591059
TypeImpl computePatternSchema(ResolverVisitor resolverVisitor) {
10601060
var element = element2;
1061-
if (element is PromotableElementImpl2) {
1061+
if (element is PromotableElementImpl) {
10621062
return resolverVisitor
10631063
.analyzeAssignedVariablePatternSchema(element)
10641064
.unwrapTypeSchemaView();
@@ -3365,7 +3365,7 @@ final class CatchClauseParameterImpl extends AstNodeImpl
33653365
}
33663366

33673367
@override
3368-
LocalVariableElementImpl2? get declaredElement2 {
3368+
LocalVariableElementImpl? get declaredElement2 {
33693369
return declaredFragment?.element;
33703370
}
33713371

@@ -6232,7 +6232,7 @@ final class DeclaredIdentifierImpl extends DeclarationImpl
62326232

62336233
@experimental
62346234
@override
6235-
LocalVariableElementImpl2? get declaredElement2 {
6235+
LocalVariableElementImpl? get declaredElement2 {
62366236
return declaredFragment?.element;
62376237
}
62386238

@@ -6370,7 +6370,7 @@ final class DeclaredVariablePatternImpl extends VariablePatternImpl
63706370

63716371
@experimental
63726372
@override
6373-
BindPatternVariableElementImpl2? get declaredElement2 {
6373+
BindPatternVariableElementImpl? get declaredElement2 {
63746374
return declaredFragment?.element;
63756375
}
63766376

@@ -6853,7 +6853,7 @@ final class DotShorthandConstructorInvocationImpl
68536853
SimpleIdentifierImpl _constructorName;
68546854

68556855
@override
6856-
ConstructorElementImpl2? element;
6856+
ConstructorElementImpl? element;
68576857

68586858
@generated
68596859
DotShorthandConstructorInvocationImpl({
@@ -8991,7 +8991,7 @@ abstract final class ExtensionOverride implements Expression {
89918991
GenerateNodeProperty('name'),
89928992
GenerateNodeProperty('typeArguments'),
89938993
GenerateNodeProperty('argumentList'),
8994-
GenerateNodeProperty('element2', type: ExtensionElementImpl2),
8994+
GenerateNodeProperty('element2', type: ExtensionElementImpl),
89958995
],
89968996
)
89978997
final class ExtensionOverrideImpl extends ExpressionImpl
@@ -9011,7 +9011,7 @@ final class ExtensionOverrideImpl extends ExpressionImpl
90119011

90129012
@generated
90139013
@override
9014-
final ExtensionElementImpl2 element2;
9014+
final ExtensionElementImpl element2;
90159015

90169016
@override
90179017
List<DartType>? typeArgumentTypes;
@@ -12654,7 +12654,7 @@ final class GuardedPatternImpl extends AstNodeImpl implements GuardedPattern {
1265412654

1265512655
/// Variables declared in [pattern], available in [whenClause] guard, and
1265612656
/// to the `ifTrue` node.
12657-
late Map<String, PatternVariableElementImpl2> variables;
12657+
late Map<String, PatternVariableElementImpl> variables;
1265812658

1265912659
@generated
1266012660
GuardedPatternImpl({
@@ -14965,7 +14965,7 @@ final class LabelImpl extends AstNodeImpl implements Label {
1496514965

1496614966
@override
1496714967
LabelFragmentImpl? get declaredFragment =>
14968-
(label.element as LabelElementImpl2?)?.firstFragment;
14968+
(label.element as LabelElementImpl?)?.firstFragment;
1496914969

1497014970
@generated
1497114971
@override
@@ -19290,7 +19290,7 @@ final class PatternVariableDeclarationImpl extends AnnotatedNodeImpl
1929019290
TypeImpl? patternTypeSchema;
1929119291

1929219292
/// Variables declared in [pattern].
19293-
late final List<BindPatternVariableElementImpl2> elements;
19293+
late final List<BindPatternVariableElementImpl> elements;
1929419294

1929519295
@generated
1929619296
PatternVariableDeclarationImpl({
@@ -20802,7 +20802,7 @@ final class RedirectingConstructorInvocationImpl
2080220802
ArgumentListImpl _argumentList;
2080320803

2080420804
@override
20805-
ConstructorElementImpl2? element;
20805+
ConstructorElementImpl? element;
2080620806

2080720807
@generated
2080820808
RedirectingConstructorInvocationImpl({
@@ -23804,7 +23804,7 @@ class SwitchStatementCaseGroup {
2380423804
final bool hasLabels;
2380523805

2380623806
/// Joined variables declared in [members], available in [statements].
23807-
late Map<String, PromotableElementImpl2> variables;
23807+
late Map<String, PromotableElementImpl> variables;
2380823808

2380923809
SwitchStatementCaseGroup(this.members, this.hasLabels);
2381023810

@@ -25214,8 +25214,8 @@ final class VariableDeclarationImpl extends DeclarationImpl
2521425214

2521525215
@experimental
2521625216
@override
25217-
LocalVariableElementImpl2? get declaredElement2 {
25218-
return declaredFragment?.element.ifTypeOrNull<LocalVariableElementImpl2>();
25217+
LocalVariableElementImpl? get declaredElement2 {
25218+
return declaredFragment?.element.ifTypeOrNull<LocalVariableElementImpl>();
2521925219
}
2522025220

2522125221
/// This overridden implementation of [documentationComment] looks in the

pkg/analyzer/lib/src/dart/constant/evaluation.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ class ConstantEvaluationEngine {
327327
// The annotation is a reference to a compile-time constant variable,
328328
// so it depends on the variable.
329329
if (element.variable3 case var variable?) {
330-
var baseElement = variable.baseElement as VariableElementImpl2;
330+
var baseElement = variable.baseElement as VariableElementImpl;
331331
callback(baseElement.firstFragment as VariableFragmentImpl);
332332
}
333333
} else if (element is ConstructorElement) {
@@ -863,7 +863,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
863863
var typeElement = node.constructorName.type.element2;
864864

865865
TypeAliasElement? viaTypeAlias;
866-
if (typeElement is TypeAliasElementImpl2) {
866+
if (typeElement is TypeAliasElementImpl) {
867867
if (constructorFunctionType.typeFormals.isNotEmpty &&
868868
!typeElement.isProperRename) {
869869
// The type alias is not a proper rename of the aliased class, so
@@ -875,7 +875,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
875875

876876
var constructorElement =
877877
node.constructorName.element?.baseElement
878-
.ifTypeOrNull<ConstructorElementImpl2>();
878+
.ifTypeOrNull<ConstructorElementImpl>();
879879
if (constructorElement == null) {
880880
return InvalidConstant.forEntity(
881881
entity: node,
@@ -1952,7 +1952,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
19521952
);
19531953
}
19541954

1955-
if (variableElement is VariableElementImpl2) {
1955+
if (variableElement is VariableElementImpl) {
19561956
// We access values of constant variables here in two cases: when we
19571957
// compute values of other constant variables, or when we compute values
19581958
// and errors for other constant expressions. In either case we have
@@ -1992,14 +1992,14 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
19921992
);
19931993
}
19941994
}
1995-
} else if (variableElement is ConstructorElementImpl2 &&
1995+
} else if (variableElement is ConstructorElementImpl &&
19961996
expression != null) {
19971997
return DartObjectImpl(
19981998
typeSystem,
19991999
expression.typeOrThrow,
20002000
FunctionState(variableElement),
20012001
);
2002-
} else if (variableElement is ExecutableElementImpl2) {
2002+
} else if (variableElement is ExecutableElementImpl) {
20032003
if (variableElement.isStatic) {
20042004
var rawType = DartObjectImpl(
20052005
typeSystem,
@@ -2014,7 +2014,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
20142014
}
20152015
return _instantiateFunctionTypeForSimpleIdentifier(identifier, rawType);
20162016
}
2017-
} else if (variableElement is InterfaceElementImpl2) {
2017+
} else if (variableElement is InterfaceElementImpl) {
20182018
var type =
20192019
givenType ??
20202020
variableElement.instantiateImpl(
@@ -2029,13 +2029,13 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
20292029
_typeProvider.typeType,
20302030
TypeState(type),
20312031
);
2032-
} else if (variableElement is DynamicElementImpl2) {
2032+
} else if (variableElement is DynamicElementImpl) {
20332033
return DartObjectImpl(
20342034
typeSystem,
20352035
_typeProvider.typeType,
20362036
TypeState(_typeProvider.dynamicType),
20372037
);
2038-
} else if (variableElement is TypeAliasElementImpl2) {
2038+
} else if (variableElement is TypeAliasElementImpl) {
20392039
var type =
20402040
givenType ??
20412041
variableElement.instantiate(
@@ -2050,7 +2050,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
20502050
_typeProvider.typeType,
20512051
TypeState(type),
20522052
);
2053-
} else if (variableElement is NeverElementImpl2) {
2053+
} else if (variableElement is NeverElementImpl) {
20542054
return DartObjectImpl(
20552055
typeSystem,
20562056
_typeProvider.typeType,

pkg/analyzer/lib/src/dart/constant/utilities.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class ReferenceFinder extends RecursiveAstVisitor<void> {
261261
element = element.variable3;
262262
}
263263

264-
if (element is VariableElementImpl2 && element.isConst) {
264+
if (element is VariableElementImpl && element.isConst) {
265265
_callback(element.firstFragment as VariableFragmentImpl);
266266
}
267267
}

pkg/analyzer/lib/src/dart/constant/value.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ class EvaluationException {
14031403
/// The state of an object representing a function.
14041404
class FunctionState extends InstanceState {
14051405
/// The element representing the function being modeled.
1406-
final ExecutableElementImpl2 element;
1406+
final ExecutableElementImpl element;
14071407

14081408
final List<TypeImpl>? typeArguments;
14091409

0 commit comments

Comments
 (0)