@@ -2266,7 +2266,12 @@ class ConstraintSystem {
2266
2266
if (auto *decl = dyn_cast<VarDecl>(resolvedOverload->Choice .getDecl ())) {
2267
2267
if (decl->hasAttachedPropertyWrapper ()) {
2268
2268
if (auto storageWrapper = decl->getPropertyWrapperStorageWrapper ()) {
2269
- return std::make_pair (decl, storageWrapper->getType ());
2269
+ Type type = storageWrapper->getInterfaceType ();
2270
+ if (Type baseType = resolvedOverload->Choice .getBaseType ()) {
2271
+ type = baseType->getTypeOfMember (DC->getParentModule (),
2272
+ storageWrapper, type);
2273
+ }
2274
+ return std::make_pair (decl, type);
2270
2275
}
2271
2276
}
2272
2277
}
@@ -2283,6 +2288,10 @@ class ConstraintSystem {
2283
2288
if (auto *decl = dyn_cast<VarDecl>(resolvedOverload->Choice .getDecl ())) {
2284
2289
if (decl->hasAttachedPropertyWrapper ()) {
2285
2290
auto wrapperTy = decl->getPropertyWrapperBackingPropertyType ();
2291
+ if (Type baseType = resolvedOverload->Choice .getBaseType ()) {
2292
+ wrapperTy = baseType->getTypeOfMember (DC->getParentModule (),
2293
+ decl, wrapperTy);
2294
+ }
2286
2295
return std::make_pair (decl, wrapperTy);
2287
2296
}
2288
2297
}
@@ -2299,7 +2308,12 @@ class ConstraintSystem {
2299
2308
if (resolvedOverload->Choice .isDecl ()) {
2300
2309
if (auto *decl = dyn_cast<VarDecl>(resolvedOverload->Choice .getDecl ())) {
2301
2310
if (auto wrapped = decl->getOriginalWrappedProperty ()) {
2302
- return std::make_pair (decl, wrapped->getType ());
2311
+ Type type = wrapped->getInterfaceType ();
2312
+ if (Type baseType = resolvedOverload->Choice .getBaseType ()) {
2313
+ type = baseType->getTypeOfMember (DC->getParentModule (),
2314
+ wrapped, type);
2315
+ }
2316
+ return std::make_pair (decl, type);
2303
2317
}
2304
2318
}
2305
2319
}
0 commit comments