@@ -2216,7 +2216,12 @@ class ConstraintSystem {
2216
2216
if (auto *decl = dyn_cast<VarDecl>(resolvedOverload->Choice .getDecl ())) {
2217
2217
if (decl->hasAttachedPropertyWrapper ()) {
2218
2218
if (auto storageWrapper = decl->getPropertyWrapperStorageWrapper ()) {
2219
- return std::make_pair (decl, storageWrapper->getType ());
2219
+ Type type = storageWrapper->getInterfaceType ();
2220
+ if (Type baseType = resolvedOverload->Choice .getBaseType ()) {
2221
+ type = baseType->getTypeOfMember (DC->getParentModule (),
2222
+ storageWrapper, type);
2223
+ }
2224
+ return std::make_pair (decl, type);
2220
2225
}
2221
2226
}
2222
2227
}
@@ -2233,6 +2238,10 @@ class ConstraintSystem {
2233
2238
if (auto *decl = dyn_cast<VarDecl>(resolvedOverload->Choice .getDecl ())) {
2234
2239
if (decl->hasAttachedPropertyWrapper ()) {
2235
2240
auto wrapperTy = decl->getPropertyWrapperBackingPropertyType ();
2241
+ if (Type baseType = resolvedOverload->Choice .getBaseType ()) {
2242
+ wrapperTy = baseType->getTypeOfMember (DC->getParentModule (),
2243
+ decl, wrapperTy);
2244
+ }
2236
2245
return std::make_pair (decl, wrapperTy);
2237
2246
}
2238
2247
}
@@ -2249,7 +2258,12 @@ class ConstraintSystem {
2249
2258
if (resolvedOverload->Choice .isDecl ()) {
2250
2259
if (auto *decl = dyn_cast<VarDecl>(resolvedOverload->Choice .getDecl ())) {
2251
2260
if (auto wrapped = decl->getOriginalWrappedProperty ()) {
2252
- return std::make_pair (decl, wrapped->getType ());
2261
+ Type type = wrapped->getInterfaceType ();
2262
+ if (Type baseType = resolvedOverload->Choice .getBaseType ()) {
2263
+ type = baseType->getTypeOfMember (DC->getParentModule (),
2264
+ wrapped, type);
2265
+ }
2266
+ return std::make_pair (decl, type);
2253
2267
}
2254
2268
}
2255
2269
}
0 commit comments