@@ -174,36 +174,6 @@ static void revertDependentTypeLoc(TypeLoc &tl) {
174
174
tl.setType (Type ());
175
175
}
176
176
177
- // / Revert the dependent types within the given generic parameter list.
178
- static void revertGenericParamList (TypeChecker &tc,
179
- GenericParamList *genericParams) {
180
- // Revert the requirements of the generic parameter list.
181
- tc.revertGenericRequirements (genericParams->getRequirements ());
182
- }
183
-
184
- void TypeChecker::revertGenericRequirements (
185
- MutableArrayRef<RequirementRepr> requirements) {
186
- for (auto &req : requirements) {
187
- if (req.isInvalid ())
188
- continue ;
189
-
190
- switch (req.getKind ()) {
191
- case RequirementReprKind::TypeConstraint:
192
- revertDependentTypeLoc (req.getConstraintLoc ());
193
- LLVM_FALLTHROUGH;
194
-
195
- case RequirementReprKind::LayoutConstraint:
196
- revertDependentTypeLoc (req.getSubjectLoc ());
197
- break ;
198
-
199
- case RequirementReprKind::SameType:
200
- revertDependentTypeLoc (req.getFirstTypeLoc ());
201
- revertDependentTypeLoc (req.getSecondTypeLoc ());
202
- break ;
203
- }
204
- }
205
- }
206
-
207
177
// /
208
178
// / Generic functions
209
179
// /
@@ -533,7 +503,6 @@ computeGenericFuncSignature(TypeChecker &tc, AbstractFunctionDecl *func) {
533
503
// there might still be errors that have not yet been diagnosed. Revert the
534
504
// generic function signature and type-check it again, completely.
535
505
revertGenericFuncSignature (func);
536
- revertGenericParamList (tc, gp);
537
506
538
507
// Debugging of the generic signature.
539
508
if (tc.Context .LangOpts .DebugGenericSignatures ) {
@@ -652,7 +621,6 @@ TypeChecker::validateGenericSubscriptSignature(SubscriptDecl *subscript) {
652
621
// there might still be errors that have not yet been diagnosed. Revert the
653
622
// generic function signature and type-check it again, completely.
654
623
revertGenericSubscriptSignature (subscript);
655
- revertGenericParamList (*this , gp);
656
624
657
625
// Debugging of generic signature generation.
658
626
if (Context.LangOpts .DebugGenericSignatures ) {
@@ -767,18 +735,6 @@ GenericEnvironment *TypeChecker::checkGenericEnvironment(
767
735
genericParams->getSourceRange ().Start ,
768
736
allowConcreteGenericParams);
769
737
770
- // The generic signature builder now has all of the requirements, although
771
- // there might still be errors that have not yet been diagnosed. Revert the
772
- // signature and type-check it again, completely.
773
- if (recursivelyVisitGenericParams) {
774
- visitOuterToInner (genericParams,
775
- [&](GenericParamList *gpList) {
776
- revertGenericParamList (*this , gpList);
777
- });
778
- } else {
779
- revertGenericParamList (*this , genericParams);
780
- }
781
-
782
738
// Debugging of the generic signature builder and generic signature
783
739
// generation.
784
740
if (Context.LangOpts .DebugGenericSignatures ) {
0 commit comments