@@ -1382,7 +1382,9 @@ namespace {
1382
1382
VarDecl *field = dyn_cast<VarDecl>(Storage);
1383
1383
VarDecl *backingVar = field->getPropertyWrapperBackingProperty ();
1384
1384
assert (backingVar);
1385
- CanType ValType = backingVar->getType ()->getCanonicalType ();
1385
+ CanType ValType =
1386
+ SGF.F .mapTypeIntoContext (backingVar->getInterfaceType ())
1387
+ ->getCanonicalType ();
1386
1388
SILType varStorageType =
1387
1389
SGF.SGM .Types .getSubstitutedStorageType (backingVar, ValType);
1388
1390
auto typeData =
@@ -1405,7 +1407,7 @@ namespace {
1405
1407
assert (field->getAttachedPropertyWrappers ().size () == 1 );
1406
1408
auto wrapperInfo = field->getAttachedPropertyWrapperTypeInfo (0 );
1407
1409
auto ctor = wrapperInfo.wrappedValueInit ;
1408
- SubstitutionMap subs = backingVar-> getType () ->getMemberSubstitutionMap (
1410
+ SubstitutionMap subs = ValType ->getMemberSubstitutionMap (
1409
1411
SGF.getModule ().getSwiftModule (), ctor);
1410
1412
1411
1413
Type ity = ctor->getInterfaceType ();
@@ -1416,8 +1418,8 @@ namespace {
1416
1418
.asForeign (requiresForeignEntryPoint (ctor));
1417
1419
RValue initFuncRV =
1418
1420
SGF.emitApplyPropertyWrapperAllocator (loc, subs,initRef,
1419
- backingVar-> getType () ,
1420
- CanAnyFunctionType (substIty));
1421
+ ValType ,
1422
+ CanAnyFunctionType (substIty));
1421
1423
ManagedValue initFn = std::move (initFuncRV).getAsSingleValue (SGF, loc);
1422
1424
1423
1425
// Create the allocating setter function. It captures the base address.
0 commit comments