mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10950 from ethereum/removeChecks
[SolYul] Remove (hopefully) unnecessary checks.
This commit is contained in:
commit
1716dcfb57
@ -893,17 +893,7 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto memberAccess = dynamic_cast<MemberAccess const*>(&_functionCall.expression());
|
auto const* 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, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (functionType->kind())
|
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