Skip to content

Commit 0c00d45

Browse files
committed
[CSDiag] Remove CalleeCandidateInfo::diagnoseSimpleErrors, which is
dead code now.
1 parent 7fb27b3 commit 0c00d45

File tree

4 files changed

+0
-49
lines changed

4 files changed

+0
-49
lines changed

docs/TypeChecker.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,5 +986,3 @@ The things in the queue yet to be ported are:
986986
- Missing explicit ``Self.`` and ``self.``
987987
- Logic related to overload candidate ranking (``CalleeCandidateInfo``)
988988
- ``diagnoseParameterErrors``
989-
- ``diagnoseSimpleErrors``
990-

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,10 +1403,6 @@ bool FailureDiagnosis::visitApplyExpr(ApplyExpr *callExpr) {
14031403
argLabels))
14041404
return true;
14051405

1406-
// Diagnose some simple and common errors.
1407-
if (calleeInfo.diagnoseSimpleErrors(callExpr))
1408-
return true;
1409-
14101406
// Force recheck of the arg expression because we allowed unresolved types
14111407
// before, and that turned out not to help, and now we want any diagnoses
14121408
// from disallowing them.

lib/Sema/CalleeCandidateInfo.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -945,41 +945,3 @@ suggestPotentialOverloads(SourceLoc loc, bool isResult) {
945945
suggestionText);
946946
}
947947
}
948-
949-
/// Emit a diagnostic and return true if this is an error condition we can
950-
/// handle uniformly. This should be called after filtering the candidate
951-
/// list.
952-
bool CalleeCandidateInfo::diagnoseSimpleErrors(const Expr *E) {
953-
SourceLoc loc = E->getLoc();
954-
955-
// Handle symbols marked as explicitly unavailable.
956-
if (closeness == CC_Unavailable) {
957-
auto decl = candidates[0].getDecl();
958-
assert(decl && "Only decl-based candidates may be marked unavailable");
959-
return diagnoseExplicitUnavailability(decl, loc, CS.DC,
960-
dyn_cast<CallExpr>(E));
961-
}
962-
963-
// Handle symbols that are matches, but are not accessible from the current
964-
// scope.
965-
if (closeness == CC_Inaccessible) {
966-
auto decl = candidates[0].getDecl();
967-
assert(decl && "Only decl-based candidates may be marked inaccessible");
968-
969-
InaccessibleMemberFailure failure(
970-
CS, decl, CS.getConstraintLocator(const_cast<Expr *>(E)));
971-
auto diagnosed = failure.diagnoseAsError();
972-
assert(diagnosed && "failed to produce expected diagnostic");
973-
974-
for (auto cand : candidates) {
975-
auto *candidate = cand.getDecl();
976-
if (candidate && candidate != decl)
977-
candidate->diagnose(diag::decl_declared_here, candidate->getFullName());
978-
}
979-
980-
return true;
981-
}
982-
983-
return false;
984-
}
985-

lib/Sema/CalleeCandidateInfo.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,6 @@ namespace swift {
227227
/// overloads.
228228
void suggestPotentialOverloads(SourceLoc loc, bool isResult = false);
229229

230-
/// Emit a diagnostic and return true if this is an error condition we can
231-
/// handle uniformly. This should be called after filtering the candidate
232-
/// list.
233-
bool diagnoseSimpleErrors(const Expr *E);
234-
235230
void dump(llvm::raw_ostream &os) const;
236231
SWIFT_DEBUG_DUMP;
237232

0 commit comments

Comments
 (0)