Skip to content

Commit b115092

Browse files
committed
SILGen: Remove a usage of replaceCovariantResultType()
1 parent 588abbc commit b115092

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILGen/SILGenApply.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ getPartialApplyOfDynamicMethodFormalType(SILGenModule &SGM, SILDeclRef member,
148148

149149
// Adjust the result type to replace dynamic-self with AnyObject.
150150
CanType resultType = completeMethodTy.getResult();
151-
if (auto fnDecl = dyn_cast<FuncDecl>(member.getDecl())) {
152-
if (fnDecl->hasDynamicSelfResult()) {
151+
if (isa<FuncDecl>(member.getDecl())) {
152+
if (resultType->hasDynamicSelfType()) {
153153
auto anyObjectTy = SGM.getASTContext().getAnyObjectType();
154-
resultType = resultType->replaceCovariantResultType(anyObjectTy, 0)
154+
resultType = resultType->replaceDynamicSelfType(anyObjectTy)
155155
->getCanonicalType();
156156
}
157157
}

0 commit comments

Comments
 (0)