Skip to content

Commit 339053f

Browse files
committed
AnalysisFramework.formatErrors(): Fix _withErrorIds flag not having any effect
1 parent a59fc39 commit 339053f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

test/libsolidity/AnalysisFramework.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,17 @@ ErrorList AnalysisFramework::expectError(std::string const& _source, bool _warni
147147
}
148148

149149
string AnalysisFramework::formatErrors(
150-
langutil::ErrorList _errors,
150+
langutil::ErrorList const& _errors,
151151
bool _colored,
152152
bool _withErrorIds
153153
) const
154154
{
155-
string message;
156-
for (auto const& error: _errors)
157-
message += formatError(*error, _colored, _withErrorIds);
158-
return message;
155+
return SourceReferenceFormatter::formatErrorInformation(
156+
_errors,
157+
*m_compiler,
158+
_colored,
159+
_withErrorIds
160+
);
159161
}
160162

161163
string AnalysisFramework::formatError(
@@ -164,9 +166,8 @@ string AnalysisFramework::formatError(
164166
bool _withErrorIds
165167
) const
166168
{
167-
return SourceReferenceFormatter::formatExceptionInformation(
169+
return SourceReferenceFormatter::formatErrorInformation(
168170
_error,
169-
_error.type(),
170171
*m_compiler,
171172
_colored,
172173
_withErrorIds

test/libsolidity/AnalysisFramework.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class AnalysisFramework
5858
langutil::ErrorList expectError(std::string const& _source, bool _warning = false, bool _allowMultiple = false);
5959

6060
std::string formatErrors(
61-
langutil::ErrorList _errors,
61+
langutil::ErrorList const& _errors,
6262
bool _colored = false,
6363
bool _withErrorIds = false
6464
) const;

0 commit comments

Comments
 (0)