[Diagnostics] NFC: Adjust all diagnostics improved/changed by static member refs on protocol metatypes feature

This commit is contained in:
Pavel Yaskevich
2020-10-30 14:40:01 -07:00
parent feb8684dac
commit 30f255755b
4 changed files with 16 additions and 10 deletions

View File

@@ -6881,6 +6881,13 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
if (auto *fnType = resultTy->getAs<FunctionType>())
resultTy = fnType->getResult();
// No reason to suggest that `Void` doesn't conform to some protocol.
if (resultTy->isVoid()) {
result.addUnviable(candidate,
MemberLookupResult::UR_TypeMemberOnInstance);
return;
}
// If result is not a concrete type which could conform to the
// expected protocol, this method is only viable for diagnostics.
if (!(resultTy->is<NominalType>() || resultTy->is<BoundGenericType>()) ||