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