Skip to content

Commit d4ae826

Browse files
[Localization] Assert if printDiagnosticNames is true; the StringSaver is also present
1 parent b34cf95 commit d4ae826

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Localization/LocalizationFormat.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ LocalizationProducer::getMessageOr(swift::DiagID id,
9898
if (localizedMessage.empty())
9999
return defaultMessage;
100100
llvm::StringRef diagnosticName(diagnosticNameStrings[(unsigned)id]);
101-
if (localizationSaver && printDiagnosticName) {
101+
if (printDiagnosticName) {
102+
assert(localizationSaver);
102103
auto localizedDebugDiagnosticMessage =
103104
localizationSaver->save(localizedMessage.str() + diagnosticName.str());
104105
return localizedDebugDiagnosticMessage;

0 commit comments

Comments
 (0)