[ConstraintSystem] Mark member result type as a potential hole if base was incorrect

If it has been established that member found via static member
lookup on protocol metatype doesn't have correct result type,
chain's result type the should be treated as a hole.
This commit is contained in:
Pavel Yaskevich
2020-10-30 13:52:20 -07:00
parent d1ab178471
commit dcd746906f
2 changed files with 30 additions and 0 deletions

View File

@@ -4556,6 +4556,10 @@ bool ConstraintSystem::repairFailures(
}
case ConstraintLocator::UnresolvedMemberChainResult: {
// Ignore this mismatch if result is already a hole.
if (rhs->isHole())
return true;
if (repairViaOptionalUnwrap(*this, lhs, rhs, matchKind, conversionsOrFixes,
locator))
break;