mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove unnecessary checks.
This commit is contained in:
parent
72c6932bf5
commit
45dc705683
@ -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())
|
||||
{
|
||||
|
17
test/libsolidity/semanticTests/structs/event.sol
Normal file
17
test/libsolidity/semanticTests/structs/event.sol
Normal 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() ->
|
Loading…
Reference in New Issue
Block a user