[CSDiagnostics] Adjust diagnostics to account that type holes in solution are UnresolvedType

This commit is contained in:
Pavel Yaskevich
2020-08-26 18:45:17 -07:00
parent d039107bdb
commit b4d3237bea
3 changed files with 22 additions and 18 deletions

View File

@@ -5057,7 +5057,7 @@ bool CollectionElementContextualFailure::diagnoseAsError() {
// holes present in the contextual type.
if (FailureDiagnostic::getContextualTypePurpose(getAnchor()) ==
ContextualTypePurpose::CTP_ForEachStmt &&
contextualType->hasHole()) {
contextualType->hasUnresolvedType()) {
diagnostic.emplace(emitDiagnostic(
(contextualType->is<TupleType>() && !eltType->is<TupleType>())
? diag::cannot_match_expr_tuple_pattern_with_nontuple_value
@@ -6315,7 +6315,7 @@ bool UnableToInferClosureParameterType::diagnoseAsError() {
if (parentExpr) {
// Missing or invalid member reference in call.
if (auto *AE = dyn_cast<ApplyExpr>(parentExpr)) {
if (getType(AE->getFn())->isHole())
if (getType(AE->getFn())->is<UnresolvedType>())
return false;
}