Skip to content

Commit ee00acf

Browse files
committed
[AST] Remove GenericSignature::getRepresentative(). NFC
This entrypoint is unused and is a Bad Idea (TM). Remove it.
1 parent ded7e83 commit ee00acf

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

include/swift/AST/GenericSignature.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,6 @@ class alignas(1 << TypeAlignInBits) GenericSignature final
217217
/// constraint.
218218
LayoutConstraint getLayoutConstraint(Type type, ModuleDecl &mod);
219219

220-
/// Return the preferred representative of the given type parameter within
221-
/// this generic signature. This may yield a concrete type or a
222-
/// different type parameter.
223-
Type getRepresentative(Type type, ModuleDecl &mod);
224-
225220
/// Return whether two type parameters represent the same type under this
226221
/// generic signature.
227222
///

lib/AST/GenericSignature.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -520,21 +520,6 @@ LayoutConstraint GenericSignature::getLayoutConstraint(Type type,
520520
return pa->getLayout();
521521
}
522522

523-
Type GenericSignature::getRepresentative(Type type, ModuleDecl &mod) {
524-
assert(type->isTypeParameter());
525-
auto &builder = *getArchetypeBuilder(mod);
526-
auto pa = builder.resolveArchetype(type);
527-
assert(pa && "not a valid dependent type of this signature?");
528-
auto rep = pa->getRepresentative();
529-
if (rep->isConcreteType()) return rep->getConcreteType();
530-
if (pa == rep) {
531-
assert(rep->getDependentType(getGenericParams(), /*allowUnresolved*/ false)
532-
->isEqual(type));
533-
return type;
534-
}
535-
return rep->getDependentType(getGenericParams(), /*allowUnresolved*/ false);
536-
}
537-
538523
bool GenericSignature::areSameTypeParameterInContext(Type type1, Type type2,
539524
ModuleDecl &mod) {
540525
assert(type1->isTypeParameter());

0 commit comments

Comments
 (0)