Skip to content

Commit 493de63

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Remove FormalParameterElementOrMember class.
The only reason this class was needed was to serve as a common interface (not part of the analyzer public API) shared by `ParameterMember` and `FormalParameterElementImpl`, which could be used as a type argument when the analyzer instantiates generic classes in `_fe_analyzer_shared`. Now that we have `FormalParameterElementMixin`, it can serve as the common interface. Change-Id: Idc25ca4077dc9c801d7eeb2e54b0d6b7809f1912 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404362 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent fb3255d commit 493de63

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4513,8 +4513,7 @@ class FormalParameterElementImpl extends PromotableElementImpl2
45134513
FragmentedElementMixin<FormalParameterFragment>,
45144514
FormalParameterElementMixin,
45154515
_HasSinceSdkVersionMixin,
4516-
_NonTopLevelVariableOrParameter
4517-
implements FormalParameterElementOrMember {
4516+
_NonTopLevelVariableOrParameter {
45184517
final ParameterElementImpl wrappedElement;
45194518

45204519
FormalParameterElementImpl(this.wrappedElement) {
@@ -4658,7 +4657,10 @@ class FormalParameterElementImpl extends PromotableElementImpl2
46584657

46594658
/// A mixin that provides a common implementation for methods defined in
46604659
/// [FormalParameterElement].
4661-
mixin FormalParameterElementMixin implements FormalParameterElement {
4660+
mixin FormalParameterElementMixin
4661+
implements
4662+
FormalParameterElement,
4663+
SharedNamedFunctionParameterStructure<TypeImpl> {
46624664
@override
46634665
void appendToWithoutDelimiters2(StringBuffer buffer) {
46644666
buffer.write(
@@ -4673,11 +4675,6 @@ mixin FormalParameterElementMixin implements FormalParameterElement {
46734675
}
46744676
}
46754677

4676-
abstract class FormalParameterElementOrMember
4677-
implements
4678-
FormalParameterElement,
4679-
SharedNamedFunctionParameterStructure<TypeImpl> {}
4680-
46814678
mixin FragmentedAnnotatableElementMixin<E extends Fragment>
46824679
implements FragmentedElementMixin<E> {
46834680
String? get documentationComment {

pkg/analyzer/lib/src/dart/element/member.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ class MethodMember extends ExecutableMember
11351135
/// type parameters are known.
11361136
class ParameterMember extends VariableMember
11371137
with ParameterElementMixin, FormalParameterElementMixin
1138-
implements ParameterElement, FormalParameterElementOrMember {
1138+
implements ParameterElement {
11391139
@override
11401140
final List<TypeParameterElement> typeParameters;
11411141

pkg/analyzer/lib/src/dart/element/type.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class FunctionTypeImpl extends TypeImpl
9191
implements
9292
FunctionType,
9393
SharedFunctionTypeStructure<TypeImpl, TypeParameterElementImpl2,
94-
FormalParameterElementOrMember> {
94+
FormalParameterElementMixin> {
9595
@override
9696
late int hashCode = _computeHashCode();
9797

@@ -243,9 +243,9 @@ class FunctionTypeImpl extends TypeImpl
243243
// TODO(paulberry): see if this type can be changed to
244244
// `List<FormalParameterElementImpl>`. See
245245
// https://dart-review.googlesource.com/c/sdk/+/402341/comment/b1669e20_15938fcd/.
246-
List<FormalParameterElementOrMember> get sortedNamedParametersShared =>
246+
List<FormalParameterElementMixin> get sortedNamedParametersShared =>
247247
sortedNamedParameters
248-
.map((p) => p.asElement2 as FormalParameterElementOrMember)
248+
.map((p) => p.asElement2 as FormalParameterElementMixin)
249249
.toList();
250250

251251
@override

pkg/analyzer/lib/src/dart/element/type_constraint_gatherer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ typedef UnknownTypeConstraintOrigin = shared.UnknownTypeConstraintOrigin<
101101
/// attempt to make one type schema a subtype of another.
102102
class TypeConstraintGatherer extends shared.TypeConstraintGenerator<
103103
DartType,
104-
FormalParameterElementOrMember,
104+
FormalParameterElementMixin,
105105
PromotableElementImpl2,
106106
TypeParameterElementImpl2,
107107
InterfaceTypeImpl,
@@ -110,7 +110,7 @@ class TypeConstraintGatherer extends shared.TypeConstraintGenerator<
110110
with
111111
shared.TypeConstraintGeneratorMixin<
112112
DartType,
113-
FormalParameterElementOrMember,
113+
FormalParameterElementMixin,
114114
PromotableElementImpl2,
115115
TypeParameterElementImpl2,
116116
InterfaceTypeImpl,

pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ class TypeSystemOperations
515515
@override
516516
TypeConstraintGenerator<
517517
DartType,
518-
FormalParameterElementOrMember,
518+
FormalParameterElementMixin,
519519
PromotableElementImpl2,
520520
TypeParameterElementImpl2,
521521
InterfaceTypeImpl,

0 commit comments

Comments
 (0)