Merge pull request #6484 from sifmelcara/create-SourceReferenceFormatter-shortcut

Add a shortcut for formatting error information
This commit is contained in:
Leonardo
2019-04-12 12:34:08 +02:00
committed by GitHub
13 changed files with 34 additions and 55 deletions
+1 -4
View File
@@ -53,10 +53,7 @@ pair<string, string> IRGenerator::run(ContractDefinition const& _contract)
{
string errorMessage;
for (auto const& error: asmStack.errors())
errorMessage += langutil::SourceReferenceFormatter::formatExceptionInformation(
*error,
(error->type() == langutil::Error::Type::Warning) ? "Warning" : "Error"
);
errorMessage += langutil::SourceReferenceFormatter::formatErrorInformation(*error);
solAssert(false, "Invalid IR generated:\n" + errorMessage + "\n" + ir);
}
asmStack.optimize();