Merge pull request #10950 from ethereum/removeChecks

[SolYul] Remove (hopefully) unnecessary checks.
This commit is contained in:
chriseth 2021-02-11 14:10:05 +01:00 committed by GitHub
commit 1716dcfb57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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() ->