diff --git a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp index 66e1e9393..be8942f65 100644 --- a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp +++ b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp @@ -893,17 +893,7 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall) return; } - auto memberAccess = dynamic_cast(&_functionCall.expression()); - if (memberAccess) - { - if (auto expressionType = dynamic_cast(memberAccess->expression().annotation().type)) - { - solAssert(!functionType->bound(), ""); - if (auto contractType = dynamic_cast(expressionType->actualType())) - if (contractType->contractDefinition().isLibrary()) - solAssert(functionType->kind() == FunctionType::Kind::Internal || functionType->kind() == FunctionType::Kind::DelegateCall, ""); - } - } + auto const* memberAccess = dynamic_cast(&_functionCall.expression()); switch (functionType->kind()) { diff --git a/test/libsolidity/semanticTests/structs/event.sol b/test/libsolidity/semanticTests/structs/event.sol new file mode 100644 index 000000000..191f4f892 --- /dev/null +++ b/test/libsolidity/semanticTests/structs/event.sol @@ -0,0 +1,17 @@ +pragma abicoder v2; + +struct Item {uint x;} +library L { + event Ev(Item); + function o() public { emit L.Ev(Item(1)); } +} +contract C { + function f() public { + L.o(); + } +} +// ==== +// compileViaYul: also +// ---- +// library: L +// f() ->