Skip to content

Commit ea34392

Browse files
committed
[GSB] Eliminate the ridiculous ad hoc recursion-breaking code.
We're now properly delaying all recursive requirements, so we no longer need to compute `grossCount`.
1 parent ae5091b commit ea34392

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,37 +1063,6 @@ bool FloatingRequirementSource::isRecursive(
10631063
return true;
10641064
}
10651065

1066-
// For a nested type match, look for another type with that name.
1067-
// FIXME: Actually, look for 5 of them. This is totally bogus.
1068-
if (kind == NestedTypeNameMatch) {
1069-
unsigned grossCount = 0;
1070-
auto pa = storage.dyn_cast<const RequirementSource *>()
1071-
->getAffectedPotentialArchetype();
1072-
while (auto parent = pa->getParent()) {
1073-
if (pa->getNestedName() == nestedName) {
1074-
if (++grossCount > 4) {
1075-
++NumRecursive;
1076-
return true;
1077-
}
1078-
}
1079-
1080-
pa = parent;
1081-
}
1082-
1083-
// Also check the root type.
1084-
grossCount = 0;
1085-
for (Type type = rootType;
1086-
auto depTy = type->getAs<DependentMemberType>();
1087-
type = depTy->getBase()) {
1088-
if (depTy->getName() == nestedName) {
1089-
if (++grossCount > 4) {
1090-
++NumRecursive;
1091-
return true;
1092-
}
1093-
}
1094-
}
1095-
}
1096-
10971066
return false;
10981067
}
10991068

0 commit comments

Comments
 (0)