AST/SourceKit: Fix printing of inheritance clauses (sort of)

This still needs a lot more cleanup.
This commit is contained in:
Slava Pestov
2024-03-01 11:41:03 -05:00
parent 37dbd05354
commit a535948e3b
6 changed files with 73 additions and 12 deletions

View File

@@ -335,7 +335,13 @@ static void initDocGenericParams(const Decl *D, DocEntityInfo &Info,
if (auto *typeDC = GC->getInnermostTypeContext())
Proto = typeDC->getSelfProtocolDecl();
for (auto Req: GenericSig.getRequirements()) {
SmallVector<Requirement, 2> Reqs;
SmallVector<InverseRequirement, 2> InverseReqs;
GenericSig->getRequirementsWithInverses(Reqs, InverseReqs);
// FIXME: Handle InverseReqs, or change the above to getRequirements()
// and update tests to include Copyable/Escapable
for (auto Req: Reqs) {
if (Proto &&
Req.getKind() == RequirementKind::Conformance &&
Req.getFirstType()->isEqual(Proto->getSelfInterfaceType()) &&