Accessors for exceptions.

This commit is contained in:
chriseth
2021-12-01 14:26:23 +01:00
parent cc2a8609d6
commit b6bd85202c
7 changed files with 20 additions and 8 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ ErrorList AnalysisFramework::filterErrors(ErrorList const& _errorList, bool _inc
for (auto const& messagePrefix: m_messagesToCut)
if (currentError->comment()->find(messagePrefix) == 0)
{
SourceLocation const* location = boost::get_error_info<errinfo_sourceLocation>(*currentError);
SourceLocation const* location = currentError->sourceLocation();
// sufficient for now, but in future we might clone the error completely, including the secondary location
newError = make_shared<Error>(
currentError->errorId(),
+3 -2
View File
@@ -118,9 +118,10 @@ void SyntaxTest::filterObtainedErrors()
{
for (auto const& currentError: filterErrors(compiler().errors(), true))
{
int locationStart = -1, locationEnd = -1;
int locationStart = -1;
int locationEnd = -1;
string sourceName;
if (auto location = boost::get_error_info<errinfo_sourceLocation>(*currentError))
if (SourceLocation const* location = currentError->sourceLocation())
{
solAssert(location->sourceName, "");
sourceName = *location->sourceName;