Skip to content

Commit 9be81d0

Browse files
committed
Sema: Clean up ConstraintSystem::getTypeOfReference()
1 parent eb56862 commit 9be81d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/TypeOfReference.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,11 +1010,11 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
10101010

10111011
// If this is a method whose result type is dynamic Self, replace
10121012
// DynamicSelf with the actual object type.
1013-
if (func->getResultInterfaceType()->hasDynamicSelfType()) {
1013+
if (openedType->hasDynamicSelfType()) {
10141014
auto params = openedType->getParams();
10151015
assert(params.size() == 1);
10161016
Type selfTy = params.front().getPlainType()->getMetatypeInstanceType();
1017-
openedType = openedType->replaceCovariantResultType(selfTy, 2)
1017+
openedType = openedType->replaceDynamicSelfType(selfTy)
10181018
->castTo<FunctionType>();
10191019
}
10201020

0 commit comments

Comments
 (0)