@@ -395,7 +395,7 @@ std::string ASTMangler::mangleKeyPathGetterThunkHelper(
395395 sub = sub.transformRec ([](Type t) -> std::optional<Type> {
396396 if (auto *openedExistential = t->getAs <ExistentialArchetypeType>()) {
397397 auto &ctx = openedExistential->getASTContext ();
398- return GenericTypeParamType::getType ( 0 , 0 , ctx) ;
398+ return ctx. TheSelfType ;
399399 }
400400 return std::nullopt ;
401401 });
@@ -431,7 +431,7 @@ std::string ASTMangler::mangleKeyPathSetterThunkHelper(
431431 sub = sub.transformRec ([](Type t) -> std::optional<Type> {
432432 if (auto *openedExistential = t->getAs <ExistentialArchetypeType>()) {
433433 auto &ctx = openedExistential->getASTContext ();
434- return GenericTypeParamType::getType ( 0 , 0 , ctx) ;
434+ return ctx. TheSelfType ;
435435 }
436436 return std::nullopt ;
437437 });
@@ -5274,15 +5274,11 @@ static void extractExistentialInverseRequirements(
52745274
52755275 auto &ctx = PCT->getASTContext ();
52765276
5277- // Form a parameter referring to the existential's Self.
5278- auto existentialSelf =
5279- GenericTypeParamType::getType (/* depth=*/ 0 , /* index=*/ 0 , ctx);
5280-
52815277 for (auto ip : PCT->getInverses ()) {
52825278 auto *proto = ctx.getProtocol (getKnownProtocolKind (ip));
52835279 assert (proto);
52845280 ASSERT (!getABIDecl (proto) && " can't use @abi on inverse protocols" );
5285- inverses.push_back ({existentialSelf , proto, SourceLoc ()});
5281+ inverses.push_back ({ctx. TheSelfType , proto, SourceLoc ()});
52865282 }
52875283}
52885284
0 commit comments