Skip to content

Commit fab1b03

Browse files
committed
SILGen: Use the best resilience expansion when lowering keypath indices
1 parent 32208fa commit fab1b03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3313,6 +3313,7 @@ lowerKeyPathSubscriptIndexTypes(
33133313
SmallVectorImpl<IndexTypePair> &indexPatterns,
33143314
SubscriptDecl *subscript,
33153315
SubstitutionMap subscriptSubs,
3316+
ResilienceExpansion expansion,
33163317
bool &needsGenericContext) {
33173318
// Capturing an index value dependent on the generic context means we
33183319
// need the generic context captured in the key path.
@@ -3330,11 +3331,9 @@ lowerKeyPathSubscriptIndexTypes(
33303331
indexTy = indexTy.subst(subscriptSubs);
33313332
}
33323333

3333-
// FIXME: Expansion
33343334
auto indexLoweredTy = SGM.Types.getLoweredType(
33353335
AbstractionPattern::getOpaque(),
3336-
indexTy,
3337-
ResilienceExpansion::Minimal);
3336+
indexTy, expansion);
33383337
indexLoweredTy = indexLoweredTy.mapTypeOutOfContext();
33393338
indexPatterns.push_back({indexTy->mapTypeOutOfContext()
33403339
->getCanonicalType(),
@@ -3531,6 +3530,7 @@ SILGenModule::emitKeyPathComponentForDecl(SILLocation loc,
35313530
SmallVector<IndexTypePair, 4> indexTypes;
35323531
lowerKeyPathSubscriptIndexTypes(*this, indexTypes,
35333532
decl, subs,
3533+
expansion,
35343534
needsGenericContext);
35353535

35363536
SmallVector<KeyPathPatternComponent::Index, 4> indexPatterns;

0 commit comments

Comments
 (0)