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

This commit is contained in:
wechman 2022-08-02 14:44:38 +02:00
parent c89eecf52b
commit e3f5c4c1b5
2 changed files with 7 additions and 2 deletions

View File

@ -344,7 +344,12 @@ bool ASTJsonExporter::visit(UsingForDirective const& _node)
attributes.emplace_back("functionList", std::move(functionList)); attributes.emplace_back("functionList", std::move(functionList));
} }
else 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()); attributes.emplace_back("global", _node.global());
setJsonNode(_node, "UsingForDirective", std::move(attributes)); setJsonNode(_node, "UsingForDirective", std::move(attributes));

View File

@ -2,7 +2,7 @@ using {add as +} for S;
struct S { struct S {
uint x; uint x;
} }
function add(S calldata, S calldata) pure returns (S calldata r) { function add(S calldata, S calldata) pure returns (S calldata r) {
assembly { assembly {