An extra assert for no operator for libraries in ASTJsonExporter::visit

This commit is contained in:
wechman
2022-09-28 13:07:58 +02:00
parent c89eecf52b
commit e3f5c4c1b5
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -344,7 +344,12 @@ bool ASTJsonExporter::visit(UsingForDirective const& _node)
attributes.emplace_back("functionList", std::move(functionList));
}
else
attributes.emplace_back("libraryName", toJson(*_node.functionsOrLibrary().front()));
{
solAssert(_node.functionsAndOperators().size() == 1);
auto const& functionAndOperator = _node.functionsAndOperators().front();
solAssert(!functionAndOperator.second.has_value());
attributes.emplace_back("libraryName", toJson(*(functionAndOperator.first)));
}
attributes.emplace_back("global", _node.global());
setJsonNode(_node, "UsingForDirective", std::move(attributes));