@@ -565,9 +565,9 @@ void TypeChecker::checkShadowedGenericParams(GenericContext *dc) {
565
565
// / Generic types
566
566
// /
567
567
568
- // / Collect additional requirements into \p sameTypeReqs .
568
+ // / Collect additional requirements into \p extraReqs .
569
569
static void collectAdditionalExtensionRequirements (
570
- Type type, SmallVectorImpl<Requirement> &sameTypeReqs ) {
570
+ Type type, SmallVectorImpl<Requirement> &extraReqs ) {
571
571
if (type->is <ErrorType>())
572
572
return ;
573
573
@@ -587,15 +587,15 @@ static void collectAdditionalExtensionRequirements(
587
587
588
588
paramProtoTy->getRequirements (
589
589
protoTy->getDecl ()->getSelfInterfaceType (),
590
- sameTypeReqs );
590
+ extraReqs );
591
591
}
592
592
593
593
Type parentType = type->getNominalParent ();
594
594
GenericTypeDecl *genericDecl = type->getAnyGeneric ();
595
595
596
596
// Visit the parent type, if there is one.
597
597
if (parentType) {
598
- collectAdditionalExtensionRequirements (parentType, sameTypeReqs );
598
+ collectAdditionalExtensionRequirements (parentType, extraReqs );
599
599
}
600
600
601
601
// Find the nominal type.
@@ -616,16 +616,16 @@ static void collectAdditionalExtensionRequirements(
616
616
auto *gp = genericParams->getParams ()[gpIndex];
617
617
auto gpType = gp->getDeclaredInterfaceType ();
618
618
619
- sameTypeReqs .emplace_back (RequirementKind::SameType, gpType,
620
- currentBoundType->getGenericArgs ()[gpIndex]);
619
+ extraReqs .emplace_back (RequirementKind::SameType, gpType,
620
+ currentBoundType->getGenericArgs ()[gpIndex]);
621
621
}
622
622
}
623
623
624
624
// If we have a passthrough typealias, add the requirements from its
625
625
// generic signature.
626
626
if (typealias && TypeChecker::isPassThroughTypealias (typealias, nominal)) {
627
627
for (auto req : typealias->getGenericSignature ().getRequirements ())
628
- sameTypeReqs .push_back (req);
628
+ extraReqs .push_back (req);
629
629
}
630
630
}
631
631
@@ -700,7 +700,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
700
700
701
701
GenericSignature parentSig;
702
702
SmallVector<TypeLoc, 2 > inferenceSources;
703
- SmallVector<Requirement, 2 > sameTypeReqs ;
703
+ SmallVector<Requirement, 2 > extraReqs ;
704
704
if (auto VD = dyn_cast<ValueDecl>(GC->getAsDecl ())) {
705
705
parentSig = GC->getParentForLookup ()->getGenericSignatureOfContext ();
706
706
@@ -774,7 +774,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
774
774
}
775
775
}
776
776
} else if (auto *ext = dyn_cast<ExtensionDecl>(GC)) {
777
- collectAdditionalExtensionRequirements (ext->getExtendedType (), sameTypeReqs );
777
+ collectAdditionalExtensionRequirements (ext->getExtendedType (), extraReqs );
778
778
779
779
auto *extendedNominal = ext->getExtendedNominal ();
780
780
@@ -789,7 +789,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
789
789
// For tuple extensions, always build a new signature to get
790
790
// the right sugared types, since we don't want to expose the
791
791
// name of the generic parameter of BuiltinTupleDecl itself.
792
- if (sameTypeReqs .empty () && !ext->getTrailingWhereClause () &&
792
+ if (extraReqs .empty () && !ext->getTrailingWhereClause () &&
793
793
!isa<BuiltinTupleDecl>(extendedNominal)) {
794
794
return parentSig;
795
795
}
@@ -803,7 +803,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
803
803
auto request = InferredGenericSignatureRequest{
804
804
parentSig.getPointer (),
805
805
genericParams, WhereClauseOwner (GC),
806
- sameTypeReqs , inferenceSources,
806
+ extraReqs , inferenceSources,
807
807
allowConcreteGenericParams};
808
808
auto sig = evaluateOrDefault (ctx.evaluator , request,
809
809
GenericSignatureWithError ()).getPointer ();
0 commit comments