Skip to content

Commit 451737b

Browse files
committed
[SILGen] Look through base metatype to find substitutions.
1 parent 716cc5c commit 451737b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4286,11 +4286,13 @@ SILGenModule::emitKeyPathComponentForDecl(SILLocation loc,
42864286
// The mapTypeIntoContext() / mapTypeOutOfContext() dance is there
42874287
// to handle the case where baseTy being a type parameter subject
42884288
// to a superclass requirement.
4289-
componentTy = var->getValueInterfaceType().subst(
4290-
GenericEnvironment::mapTypeIntoContext(genericEnv, baseTy)
4291-
->getContextSubstitutionMap(var->getDeclContext()))
4292-
->mapTypeOutOfContext()
4293-
->getCanonicalType();
4289+
componentTy =
4290+
var->getValueInterfaceType()
4291+
.subst(GenericEnvironment::mapTypeIntoContext(
4292+
genericEnv, baseTy->getMetatypeInstanceType())
4293+
->getContextSubstitutionMap(var->getDeclContext()))
4294+
->mapTypeOutOfContext()
4295+
->getCanonicalType();
42944296
}
42954297

42964298
// The component type for an @objc optional requirement needs to be

0 commit comments

Comments
 (0)