AnalysisFramework.formatErrors(): Fix _withErrorIds flag not having any effect

This commit is contained in:
Kamil Śliwak 2023-08-08 17:19:43 +02:00
parent a59fc39f10
commit 339053f185
2 changed files with 9 additions and 8 deletions

View File

@ -147,15 +147,17 @@ ErrorList AnalysisFramework::expectError(std::string const& _source, bool _warni
}
string AnalysisFramework::formatErrors(
langutil::ErrorList _errors,
langutil::ErrorList const& _errors,
bool _colored,
bool _withErrorIds
) const
{
string message;
for (auto const& error: _errors)
message += formatError(*error, _colored, _withErrorIds);
return message;
return SourceReferenceFormatter::formatErrorInformation(
_errors,
*m_compiler,
_colored,
_withErrorIds
);
}
string AnalysisFramework::formatError(
@ -164,9 +166,8 @@ string AnalysisFramework::formatError(
bool _withErrorIds
) const
{
return SourceReferenceFormatter::formatExceptionInformation(
return SourceReferenceFormatter::formatErrorInformation(
_error,
_error.type(),
*m_compiler,
_colored,
_withErrorIds

View File

@ -58,7 +58,7 @@ protected:
langutil::ErrorList expectError(std::string const& _source, bool _warning = false, bool _allowMultiple = false);
std::string formatErrors(
langutil::ErrorList _errors,
langutil::ErrorList const& _errors,
bool _colored = false,
bool _withErrorIds = false
) const;