File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1430,13 +1430,14 @@ void SILGenModule::emitConstructor(ConstructorDecl *decl) {
1430
1430
SILDeclRef constant (decl);
1431
1431
DeclContext *declCtx = decl->getDeclContext ();
1432
1432
1433
- // Make sure that memberwise initializer of $Storage
1434
- // in a type wrapped type is always emitted because
1435
- // it would later be used to initialize $storage property.
1433
+ // Make sure that default & memberwise initializers of $Storage
1434
+ // in a type wrapped type are always emitted because they would
1435
+ // later be used to initialize its ` $storage` property.
1436
1436
if (auto *SD = declCtx->getSelfStructDecl ()) {
1437
1437
auto &ctx = SD->getASTContext ();
1438
1438
if (SD->getName () == ctx.Id_TypeWrapperStorage &&
1439
- decl->isMemberwiseInitializer ()) {
1439
+ (decl->isMemberwiseInitializer () ||
1440
+ decl == SD->getDefaultInitializer ())) {
1440
1441
#ifndef NDEBUG
1441
1442
auto *wrapped = SD->getDeclContext ()->getSelfNominalTypeDecl ();
1442
1443
assert (wrapped->hasTypeWrapper ());
You can’t perform that action at this time.
0 commit comments