Remove unnecessary checks.

This commit is contained in:
chriseth 2021-02-11 09:43:05 +01:00 committed by hrkrshnn
parent 72c6932bf5
commit 45dc705683
2 changed files with 18 additions and 11 deletions

View File

@ -893,17 +893,7 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
return;
}
auto memberAccess = dynamic_cast<MemberAccess const*>(&_functionCall.expression());
if (memberAccess)
{
if (auto expressionType = dynamic_cast<TypeType const*>(memberAccess->expression().annotation().type))
{
solAssert(!functionType->bound(), "");
if (auto contractType = dynamic_cast<ContractType const*>(expressionType->actualType()))
if (contractType->contractDefinition().isLibrary())
solAssert(functionType->kind() == FunctionType::Kind::Internal || functionType->kind() == FunctionType::Kind::DelegateCall, "");
}
}
auto const* memberAccess = dynamic_cast<MemberAccess const*>(&_functionCall.expression());
switch (functionType->kind())
{

View File

@ -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() ->