Skip to content

Commit 55b7d17

Browse files
authored
Merge pull request #9155 from CodaFi/redundant-notes-for-redundant-folks
Remove an unnecessary StringRef from a Space Engine diagnostic
2 parents 4071346 + 616284f commit 55b7d17

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3614,7 +3614,7 @@ ERROR(empty_switch_stmt,none,
36143614
ERROR(non_exhaustive_switch,none,
36153615
"%select{switch must be exhaustive, consider adding |do you want to add }0"
36163616
"%select{missing cases|a default clause}1"
3617-
"%select{:|?}0 %2", (bool, bool, StringRef))
3617+
"%select{:|?}0", (bool, bool))
36183618
NOTE(missing_particular_case,none,
36193619
"missing case: '%0'", (StringRef))
36203620
WARNING(redundant_particular_case,none,

lib/Sema/TypeCheckSwitchStmt.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ namespace {
902902
.fixItInsert(EndLoc, Buffer.str());
903903
} else {
904904
Ctx.Diags.diagnose(StartLoc, diag::non_exhaustive_switch,
905-
InEditor, uncovered.isEmpty(), "")
905+
InEditor, uncovered.isEmpty())
906906
.fixItInsert(EndLoc, Buffer.str());
907907
}
908908
return;
@@ -938,13 +938,11 @@ namespace {
938938
}
939939
}
940940

941-
Ctx.Diags
942-
.diagnose(StartLoc, diag::non_exhaustive_switch, InEditor, false,
943-
Buffer.str())
944-
.fixItInsert(EndLoc, Buffer.str());
941+
Ctx.Diags.diagnose(StartLoc, diag::non_exhaustive_switch, InEditor,
942+
false).fixItInsert(EndLoc, Buffer.str());
945943
} else {
946944
Ctx.Diags.diagnose(StartLoc, diag::non_exhaustive_switch,
947-
InEditor, false, Buffer.str());
945+
InEditor, false);
948946

949947
for (auto &uncoveredSpace : uncovered.getSpaces()) {
950948
SmallVector<Space, 4> flats;

0 commit comments

Comments
 (0)