Skip to content

Commit 616284f

Browse files
committed
Remove an unnecessary StringRef from a Space Engine diagnostic
1 parent b6494f6 commit 616284f

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
@@ -3607,7 +3607,7 @@ ERROR(empty_switch_stmt,none,
36073607
ERROR(non_exhaustive_switch,none,
36083608
"%select{switch must be exhaustive, consider adding |do you want to add }0"
36093609
"%select{missing cases|a default clause}1"
3610-
"%select{:|?}0 %2", (bool, bool, StringRef))
3610+
"%select{:|?}0", (bool, bool))
36113611
NOTE(missing_particular_case,none,
36123612
"missing case: '%0'", (StringRef))
36133613
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)