Sema: Handle storage wrappers correctly in diagnostics

This commit is contained in:
Sam Lazarus
2019-06-26 00:50:30 -04:00
committed by Pavel Yaskevich
parent 7054fcb270
commit 55b17feac1
5 changed files with 49 additions and 22 deletions

View File

@@ -4817,9 +4817,11 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
auto resolvedOverload = findSelectedOverloadFor(baseExpr);
if (resolvedOverload) {
if (auto propertyWrapper =
getPropertyWrapperInformation(resolvedOverload)) {
auto wrapperTy = propertyWrapper->second;
auto wrapper = getStorageWrapperInformation(resolvedOverload);
if (!wrapper)
wrapper = getPropertyWrapperInformation(resolvedOverload);
if (wrapper) {
auto wrapperTy = wrapper->second;
auto result = solveWithNewBaseOrName(wrapperTy, member);
if (result == SolutionKind::Solved) {
auto *fix = UsePropertyWrapperType::create(