Merge pull request #79662 from swiftlang/gaborh/dynamic-self-frt

[cxx-interop] Interpret Self as a static shorthand for FRTs
This commit is contained in:
Gábor Horváth
2025-03-20 17:54:35 +00:00
committed by GitHub
6 changed files with 63 additions and 4 deletions

View File

@@ -709,7 +709,8 @@ Expr *TypeChecker::resolveDeclRefExpr(UnresolvedDeclRefExpr *UDRE,
if (DeclContext *typeContext = DC->getInnermostTypeContext()){
Type SelfType = typeContext->getSelfInterfaceType();
if (typeContext->getSelfClassDecl())
if (typeContext->getSelfClassDecl() &&
!typeContext->getSelfClassDecl()->isForeignReferenceType())
SelfType = DynamicSelfType::get(SelfType, Context);
return new (Context)
TypeExpr(new (Context) SelfTypeRepr(SelfType, Loc));