Skip to content

Commit e8ec5be

Browse files
committed
AST: Remove a usage of replaceCovariantResultType()
1 parent 9e0dbb9 commit e8ec5be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/AST/TypeSubstitution.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,9 @@ Type TypeBase::adjustSuperclassMemberDeclType(const ValueDecl *baseDecl,
885885

886886
if (auto *afd = dyn_cast<AbstractFunctionDecl>(baseDecl)) {
887887
type = type->replaceSelfParameterType(this);
888-
if (isa<ConstructorDecl>(afd))
889-
return type->replaceCovariantResultType(this, /*uncurryLevel=*/2);
888+
if (isa<ConstructorDecl>(afd) &&
889+
afd->getDeclContext()->getSelfClassDecl())
890+
type = type->withCovariantResultType();
890891
}
891892

892893
return type->replaceDynamicSelfType(this);

0 commit comments

Comments
 (0)