Skip to content

Commit 188d218

Browse files
committed
[Archetype builder] Remove some dead code. NFC
This code was trying and failing to solve a problem that we do not have. The "problem" would have been that archetypes show up in superclass constraints, and the attempted solution---mapping them out to interface types---wouldn't actually work because resolveArchetype() doesn't work that way.
1 parent 51c2cee commit 188d218

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

lib/AST/ArchetypeBuilder.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,23 +1022,6 @@ bool ArchetypeBuilder::addSuperclassRequirement(PotentialArchetype *T,
10221022
RequirementSource Source) {
10231023
T = T->getRepresentative();
10241024

1025-
if (Superclass->hasArchetype()) {
1026-
// Map contextual type to interface type.
1027-
// FIXME: There might be a better way to do this.
1028-
Superclass = Superclass.transform(
1029-
[&](Type t) -> Type {
1030-
if (t->is<ArchetypeType>()) {
1031-
auto *pa = resolveArchetype(t);
1032-
// Why does this happen?
1033-
if (!pa)
1034-
return ErrorType::get(t);
1035-
return pa->getDependentType(/*FIXME:*/{ },
1036-
/*allowUnresolved=*/false);
1037-
}
1038-
return t;
1039-
});
1040-
}
1041-
10421025
// Make sure the concrete type fulfills the superclass requirement
10431026
// of the archetype.
10441027
if (T->isConcreteType()) {

0 commit comments

Comments
 (0)