Skip to content

Commit 8a8b569

Browse files
committed
Sema: Don't call prepareGenericParamList() on extension generic parameter lists
We've already set up the depth in bindExtensionToNominal(), and if we forget we'll hit asserts later.
1 parent 5857334 commit 8a8b569

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4554,17 +4554,6 @@ static Type formExtensionInterfaceType(TypeChecker &tc, ExtensionDecl *ext,
45544554
return resultType;
45554555
}
45564556

4557-
/// Visit the given generic parameter lists from the outermost to the innermost,
4558-
/// calling the visitor function for each list.
4559-
static void visitOuterToInner(
4560-
GenericParamList *genericParams,
4561-
llvm::function_ref<void(GenericParamList *)> visitor) {
4562-
if (auto outerGenericParams = genericParams->getOuterParameters())
4563-
visitOuterToInner(outerGenericParams, visitor);
4564-
4565-
visitor(genericParams);
4566-
}
4567-
45684557
/// Check the generic parameters of an extension, recursively handling all of
45694558
/// the parameter lists within the extension.
45704559
static std::pair<GenericEnvironment *, Type>
@@ -4578,12 +4567,6 @@ checkExtensionGenericParams(TypeChecker &tc, ExtensionDecl *ext, Type type,
45784567
formExtensionInterfaceType(tc, ext, type, genericParams,
45794568
mustInferRequirements);
45804569

4581-
// Prepare all of the generic parameter lists for generic signature
4582-
// validation.
4583-
visitOuterToInner(genericParams, [&](GenericParamList *gpList) {
4584-
tc.prepareGenericParamList(gpList, ext);
4585-
});
4586-
45874570
// Local function used to infer requirements from the extended type.
45884571
auto inferExtendedTypeReqs = [&](GenericSignatureBuilder &builder) {
45894572
auto source =

0 commit comments

Comments
 (0)