@@ -565,9 +565,9 @@ void TypeChecker::checkShadowedGenericParams(GenericContext *dc) {
565565// / Generic types
566566// /
567567
568- // / Collect additional requirements into \p sameTypeReqs .
568+ // / Collect additional requirements into \p extraReqs .
569569static void collectAdditionalExtensionRequirements (
570- Type type, SmallVectorImpl<Requirement> &sameTypeReqs ) {
570+ Type type, SmallVectorImpl<Requirement> &extraReqs ) {
571571 if (type->is <ErrorType>())
572572 return ;
573573
@@ -587,15 +587,15 @@ static void collectAdditionalExtensionRequirements(
587587
588588 paramProtoTy->getRequirements (
589589 protoTy->getDecl ()->getSelfInterfaceType (),
590- sameTypeReqs );
590+ extraReqs );
591591 }
592592
593593 Type parentType = type->getNominalParent ();
594594 GenericTypeDecl *genericDecl = type->getAnyGeneric ();
595595
596596 // Visit the parent type, if there is one.
597597 if (parentType) {
598- collectAdditionalExtensionRequirements (parentType, sameTypeReqs );
598+ collectAdditionalExtensionRequirements (parentType, extraReqs );
599599 }
600600
601601 // Find the nominal type.
@@ -616,16 +616,16 @@ static void collectAdditionalExtensionRequirements(
616616 auto *gp = genericParams->getParams ()[gpIndex];
617617 auto gpType = gp->getDeclaredInterfaceType ();
618618
619- sameTypeReqs .emplace_back (RequirementKind::SameType, gpType,
620- currentBoundType->getGenericArgs ()[gpIndex]);
619+ extraReqs .emplace_back (RequirementKind::SameType, gpType,
620+ currentBoundType->getGenericArgs ()[gpIndex]);
621621 }
622622 }
623623
624624 // If we have a passthrough typealias, add the requirements from its
625625 // generic signature.
626626 if (typealias && TypeChecker::isPassThroughTypealias (typealias, nominal)) {
627627 for (auto req : typealias->getGenericSignature ().getRequirements ())
628- sameTypeReqs .push_back (req);
628+ extraReqs .push_back (req);
629629 }
630630}
631631
@@ -700,7 +700,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
700700
701701 GenericSignature parentSig;
702702 SmallVector<TypeLoc, 2 > inferenceSources;
703- SmallVector<Requirement, 2 > sameTypeReqs ;
703+ SmallVector<Requirement, 2 > extraReqs ;
704704 if (auto VD = dyn_cast<ValueDecl>(GC->getAsDecl ())) {
705705 parentSig = GC->getParentForLookup ()->getGenericSignatureOfContext ();
706706
@@ -774,7 +774,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
774774 }
775775 }
776776 } else if (auto *ext = dyn_cast<ExtensionDecl>(GC)) {
777- collectAdditionalExtensionRequirements (ext->getExtendedType (), sameTypeReqs );
777+ collectAdditionalExtensionRequirements (ext->getExtendedType (), extraReqs );
778778
779779 auto *extendedNominal = ext->getExtendedNominal ();
780780
@@ -789,7 +789,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
789789 // For tuple extensions, always build a new signature to get
790790 // the right sugared types, since we don't want to expose the
791791 // name of the generic parameter of BuiltinTupleDecl itself.
792- if (sameTypeReqs .empty () && !ext->getTrailingWhereClause () &&
792+ if (extraReqs .empty () && !ext->getTrailingWhereClause () &&
793793 !isa<BuiltinTupleDecl>(extendedNominal)) {
794794 return parentSig;
795795 }
@@ -803,7 +803,7 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator,
803803 auto request = InferredGenericSignatureRequest{
804804 parentSig.getPointer (),
805805 genericParams, WhereClauseOwner (GC),
806- sameTypeReqs , inferenceSources,
806+ extraReqs , inferenceSources,
807807 allowConcreteGenericParams};
808808 auto sig = evaluateOrDefault (ctx.evaluator , request,
809809 GenericSignatureWithError ()).getPointer ();
0 commit comments