File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -383,10 +383,16 @@ class DeclAndTypePrinter::Implementation
383
383
printMembers (SD->getMembers ());
384
384
for (const auto *ed :
385
385
owningPrinter.interopContext .getExtensionsForNominalType (SD)) {
386
- auto sign = ed->getGenericSignature ();
387
- // FIXME: support requirements.
388
- if (!sign.getRequirements ().empty ())
389
- continue ;
386
+ SmallVector<Requirement, 2 > reqs;
387
+ SmallVector<InverseRequirement, 2 > inverseReqs;
388
+ if (auto sig = ed->getGenericSignature ()) {
389
+ sig->getRequirementsWithInverses (reqs, inverseReqs);
390
+ assert (inverseReqs.empty () &&
391
+ " Non-copyable generics not supported here!" );
392
+ // FIXME: support requirements.
393
+ if (!reqs.empty ())
394
+ continue ;
395
+ }
390
396
printMembers (ed->getMembers ());
391
397
}
392
398
},
Original file line number Diff line number Diff line change @@ -700,9 +700,14 @@ ClangRepresentation DeclAndTypeClangFunctionPrinter::printFunctionSignature(
700
700
}
701
701
if (FD->isGeneric ()) {
702
702
auto Signature = FD->getGenericSignature ().getCanonicalSignature ();
703
- auto Requirements = Signature. getRequirements ();
703
+
704
704
// FIXME: Support generic requirements.
705
- if (!Requirements.empty ())
705
+ SmallVector<Requirement, 2 > reqs;
706
+ SmallVector<InverseRequirement, 2 > inverseReqs;
707
+ Signature->getRequirementsWithInverses (reqs, inverseReqs);
708
+ assert (inverseReqs.empty () && " Non-copyable generics not supported here!" );
709
+
710
+ if (!reqs.empty ())
706
711
return ClangRepresentation::unsupported;
707
712
// Print the template and requires clauses for this function.
708
713
if (kind == FunctionSignatureKind::CxxInlineThunk)
You can’t perform that action at this time.
0 commit comments