Skip to content

Commit a4f58cc

Browse files
committed
Distributed: Replace calls to subst() on a GenericFunctionType with substGenericArgs()
1 parent c953ee1 commit a4f58cc

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib/Sema/DerivedConformanceDistributedActor.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -714,13 +714,9 @@ deriveBodyDistributedActor_unownedExecutor(AbstractFunctionDecl *getter, void *)
714714
auto substitutions = SubstitutionMap::get(
715715
buildRemoteExecutorDecl->getGenericSignature(),
716716
[&](SubstitutableType *dependentType) {
717-
if (auto gp = dyn_cast<GenericTypeParamType>(dependentType)) {
718-
if (gp->getDepth() == 0 && gp->getIndex() == 0) {
719-
return getter->getImplicitSelfDecl()->getTypeInContext();
720-
}
721-
}
722-
723-
return Type();
717+
auto gp = cast<GenericTypeParamType>(dependentType);
718+
ASSERT(gp->getDepth() == 0 && gp->getIndex() == 0);
719+
return getter->getImplicitSelfDecl()->getTypeInContext();
724720
},
725721
LookUpConformanceInModule()
726722
);
@@ -730,8 +726,8 @@ deriveBodyDistributedActor_unownedExecutor(AbstractFunctionDecl *getter, void *)
730726
DeclNameLoc(),/*implicit=*/true,
731727
AccessSemantics::Ordinary);
732728
buildRemoteExecutorExpr->setType(
733-
buildRemoteExecutorDecl->getInterfaceType()
734-
.subst(substitutions)
729+
buildRemoteExecutorDecl->getInterfaceType()->castTo<GenericFunctionType>()
730+
->substGenericArgs(substitutions)
735731
);
736732

737733
Expr *selfForBuildRemoteExecutor = DerivedConformance::createSelfDeclRef(getter);

0 commit comments

Comments
 (0)