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( string AnalysisFramework::formatErrors(
langutil::ErrorList _errors, langutil::ErrorList const& _errors,
bool _colored, bool _colored,
bool _withErrorIds bool _withErrorIds
) const ) const
{ {
string message; return SourceReferenceFormatter::formatErrorInformation(
for (auto const& error: _errors) _errors,
message += formatError(*error, _colored, _withErrorIds); *m_compiler,
return message; _colored,
_withErrorIds
);
} }
string AnalysisFramework::formatError( string AnalysisFramework::formatError(
@ -164,9 +166,8 @@ string AnalysisFramework::formatError(
bool _withErrorIds bool _withErrorIds
) const ) const
{ {
return SourceReferenceFormatter::formatExceptionInformation( return SourceReferenceFormatter::formatErrorInformation(
_error, _error,
_error.type(),
*m_compiler, *m_compiler,
_colored, _colored,
_withErrorIds _withErrorIds

View File

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