@@ -395,7 +395,7 @@ std::string ASTMangler::mangleKeyPathGetterThunkHelper(
395
395
sub = sub.transformRec ([](Type t) -> std::optional<Type> {
396
396
if (auto *openedExistential = t->getAs <ExistentialArchetypeType>()) {
397
397
auto &ctx = openedExistential->getASTContext ();
398
- return GenericTypeParamType::getType ( 0 , 0 , ctx) ;
398
+ return ctx. TheSelfType ;
399
399
}
400
400
return std::nullopt ;
401
401
});
@@ -431,7 +431,7 @@ std::string ASTMangler::mangleKeyPathSetterThunkHelper(
431
431
sub = sub.transformRec ([](Type t) -> std::optional<Type> {
432
432
if (auto *openedExistential = t->getAs <ExistentialArchetypeType>()) {
433
433
auto &ctx = openedExistential->getASTContext ();
434
- return GenericTypeParamType::getType ( 0 , 0 , ctx) ;
434
+ return ctx. TheSelfType ;
435
435
}
436
436
return std::nullopt ;
437
437
});
@@ -5274,15 +5274,11 @@ static void extractExistentialInverseRequirements(
5274
5274
5275
5275
auto &ctx = PCT->getASTContext ();
5276
5276
5277
- // Form a parameter referring to the existential's Self.
5278
- auto existentialSelf =
5279
- GenericTypeParamType::getType (/* depth=*/ 0 , /* index=*/ 0 , ctx);
5280
-
5281
5277
for (auto ip : PCT->getInverses ()) {
5282
5278
auto *proto = ctx.getProtocol (getKnownProtocolKind (ip));
5283
5279
assert (proto);
5284
5280
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 ()});
5286
5282
}
5287
5283
}
5288
5284
0 commit comments