Skip to content

Commit 73e176c

Browse files
committed
NCGenerics: fix createInitExistentialAddr call
1 parent 12f9755 commit 73e176c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/SILGen/SILGenPoly.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4495,13 +4495,18 @@ void ResultPlanner::planExpandedIntoDirect(AbstractionPattern innerOrigType,
44954495
"optional nor are we under opaque value mode");
44964496
assert(outerSubstType->isAny());
44974497

4498+
auto *module = SGF.getModule().getSwiftModule();
4499+
auto &ctx = SGF.getASTContext();
4500+
44984501
auto opaque = AbstractionPattern::getOpaque();
44994502
auto anyType = SGF.getLoweredType(opaque, outerSubstType);
45004503
auto outerResultAddr = SGF.emitTemporaryAllocation(Loc, anyType);
4504+
auto conformances =
4505+
module->collectExistentialConformances(innerSubstType, outerSubstType);
45014506

45024507
SILValue outerConcreteResultAddr = SGF.B.createInitExistentialAddr(
45034508
Loc, outerResultAddr, innerSubstType,
4504-
SGF.getLoweredType(opaque, innerSubstType), /*conformances=*/{});
4509+
SGF.getLoweredType(opaque, innerSubstType), conformances);
45054510

45064511
expandInnerTupleOuterIndirect(innerOrigType, innerSubstType,
45074512
innerOrigType, innerSubstType,

0 commit comments

Comments
 (0)