Skip to content

Commit 26b0c1f

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Remove InstanceItemDuplicateItem. It is no longer used.
Change-Id: I1b17a21ca4991fc1a3fd852eaf0f88bf7996c076 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425081 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Paul Berry <[email protected]>
1 parent c31b29e commit 26b0c1f

File tree

1 file changed

+1
-56
lines changed

1 file changed

+1
-56
lines changed

pkg/analyzer/lib/src/fine/manifest_item.dart

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -112,53 +112,6 @@ sealed class InstanceItem<E extends InstanceElementImpl2>
112112
}
113113
}
114114

115-
/// Placeholder for a name that has duplicate declared member.
116-
/// It is always given a new ID.
117-
class InstanceItemDuplicateItem
118-
extends InstanceItemMemberItem<ExecutableElementImpl2> {
119-
factory InstanceItemDuplicateItem() {
120-
return InstanceItemDuplicateItem._(
121-
id: ManifestItemId.generate(),
122-
metadata: ManifestMetadata(annotations: []),
123-
isStatic: false,
124-
);
125-
}
126-
127-
factory InstanceItemDuplicateItem.read(SummaryDataReader reader) {
128-
return InstanceItemDuplicateItem._(
129-
id: ManifestItemId.read(reader),
130-
metadata: ManifestMetadata.read(reader),
131-
isStatic: reader.readBool(),
132-
);
133-
}
134-
135-
InstanceItemDuplicateItem._({
136-
required super.id,
137-
required super.metadata,
138-
required super.isStatic,
139-
});
140-
141-
@override
142-
bool match(MatchContext context, ExecutableElementImpl2 element) {
143-
super.match(context, element); // we ignore it
144-
// Duplicate items don't have any specific information, they are just
145-
// a flag, that previously the same name was declared twice. So, there is
146-
// no way to meaningfully match them. We always return `false`, and
147-
// build a new item (and ID) for this name.
148-
//
149-
// The reason is that we don't want to prefer first or last duplicated
150-
// element, we just wait until there is no error. And once it is fixed,
151-
// we will build the actual item, with a new ID, and recompute all uses
152-
// once again.
153-
return false;
154-
}
155-
156-
@override
157-
void writeKind(BufferedSink sink) {
158-
sink.writeEnum(_InstanceItemMemberItemKind.duplicate);
159-
}
160-
}
161-
162115
class InstanceItemGetterItem extends InstanceItemMemberItem<GetterElementImpl> {
163116
final ManifestType returnType;
164117
final ManifestNode? constInitializer;
@@ -251,8 +204,6 @@ sealed class InstanceItemMemberItem<E extends ExecutableElementImpl2>
251204
) {
252205
var kind = reader.readEnum(_InstanceItemMemberItemKind.values);
253206
switch (kind) {
254-
case _InstanceItemMemberItemKind.duplicate:
255-
return InstanceItemDuplicateItem.read(reader);
256207
case _InstanceItemMemberItemKind.getter:
257208
return InstanceItemGetterItem.read(reader);
258209
case _InstanceItemMemberItemKind.method:
@@ -797,13 +748,7 @@ class TopLevelSetterItem extends TopLevelItem<SetterElementImpl> {
797748
}
798749
}
799750

800-
enum _InstanceItemMemberItemKind {
801-
duplicate,
802-
constructor,
803-
method,
804-
getter,
805-
setter,
806-
}
751+
enum _InstanceItemMemberItemKind { constructor, method, getter, setter }
807752

808753
enum _ManifestItemKind {
809754
class_,

0 commit comments

Comments
 (0)