@@ -1299,8 +1299,8 @@ emitMarkFunctionEscapeForTopLevelCodeGlobals(SILLocation loc,
1299
1299
}
1300
1300
1301
1301
void SILGenModule::emitAbstractFuncDecl (AbstractFunctionDecl *AFD) {
1302
- // Emit any default argument generators .
1303
- emitDefaultArgGenerators (AFD, AFD->getParameters ());
1302
+ // Emit default arguments and property wrapper initializers .
1303
+ emitArgumentGenerators (AFD, AFD->getParameters ());
1304
1304
1305
1305
// If this is a function at global scope, it may close over a global variable.
1306
1306
// If we're emitting top-level code, then emit a "mark_function_escape" that
@@ -1389,6 +1389,9 @@ SILFunction *SILGenModule::emitClosure(AbstractClosureExpr *ce) {
1389
1389
if (!f->isExternalDeclaration ())
1390
1390
return f;
1391
1391
1392
+ // Emit property wrapper argument generators.
1393
+ emitArgumentGenerators (ce, ce->getParameters ());
1394
+
1392
1395
emitFunctionDefinition (constant, f);
1393
1396
return f;
1394
1397
}
@@ -1587,13 +1590,17 @@ void SILGenModule::emitGlobalAccessor(VarDecl *global,
1587
1590
emitOrDelayFunction (*this , accessor);
1588
1591
}
1589
1592
1590
- void SILGenModule::emitDefaultArgGenerators (SILDeclRef::Loc decl,
1591
- ParameterList *paramList) {
1593
+ void SILGenModule::emitArgumentGenerators (SILDeclRef::Loc decl,
1594
+ ParameterList *paramList) {
1592
1595
unsigned index = 0 ;
1593
1596
for (auto param : *paramList) {
1594
1597
if (param->isDefaultArgument ())
1595
1598
emitDefaultArgGenerator (SILDeclRef::getDefaultArgGenerator (decl, index),
1596
1599
param);
1600
+
1601
+ if (param->hasExternalPropertyWrapper ())
1602
+ emitPropertyWrapperBackingInitializer (param);
1603
+
1597
1604
++index;
1598
1605
}
1599
1606
}
0 commit comments