Skip to content

Commit a7e49ee

Browse files
committed
[CSApply] Variadics: Emit LoadExpr for when base of .element is l-value
1 parent 62d25ba commit a7e49ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Sema/CSApply.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3415,6 +3415,14 @@ namespace {
34153415
}
34163416

34173417
case OverloadChoiceKind::MaterializePack: {
3418+
auto baseTy = solution.getResolvedType(base);
3419+
3420+
// Load the base tuple if necessary, materialization
3421+
// operates on r-value types only.
3422+
if (baseTy->is<LValueType>())
3423+
base = coerceToType(base, baseTy->getRValueType(),
3424+
cs.getConstraintLocator(base));
3425+
34183426
auto packType = solution.getResolvedType(expr);
34193427
return cs.cacheType(
34203428
MaterializePackExpr::create(cs.getASTContext(),

0 commit comments

Comments
 (0)