From ecf701133a7fc0149743d3e011e77ef3939e1a5c Mon Sep 17 00:00:00 2001 From: Kavon Farvardin Date: Tue, 16 Sep 2025 13:33:52 -0700 Subject: [PATCH] silgen: use isSelfParameter instead of custom check --- lib/SILGen/SILGenLValue.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/SILGen/SILGenLValue.cpp b/lib/SILGen/SILGenLValue.cpp index 21f051744bf87..3dc98324d91da 100644 --- a/lib/SILGen/SILGenLValue.cpp +++ b/lib/SILGen/SILGenLValue.cpp @@ -3701,8 +3701,7 @@ RValue SILGenFunction::emitRValueForNonMemberVarDecl(SILLocation loc, // If we have self, see if we are in an 'init' delegation sequence. If so, // call out to the special delegation init routine. Otherwise, use the // normal RValue emission logic. - if (var->getName() == getASTContext().Id_self && - SelfInitDelegationState != NormalSelf) { + if (var->isSelfParameter() && SelfInitDelegationState != NormalSelf) { auto rvalue = emitRValueForSelfInDelegationInit(loc, formalRValueType, accessAddr, C); return propagateRValuePastAccess(std::move(rvalue));