mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6612 from ethereum/abi-functions-assertion
Unifies behaviour for member access of ABI functions
This commit is contained in:
commit
e8ba10bfaa
@ -1401,7 +1401,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
|||||||
m_context << Instruction::DUP1 << u256(32) << Instruction::ADD;
|
m_context << Instruction::DUP1 << u256(32) << Instruction::ADD;
|
||||||
utils().storeStringData(contract.name());
|
utils().storeStringData(contract.name());
|
||||||
}
|
}
|
||||||
else if (member == "encode" || member == "decode")
|
else if ((set<string>{"encode", "encodePacked", "encodeWithSelector", "encodeWithSignature", "decode"}).count(member))
|
||||||
{
|
{
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
contract C {
|
contract C {
|
||||||
function f() public pure {
|
function f() public pure {
|
||||||
abi.encode;
|
abi.encode;
|
||||||
|
abi.encodePacked;
|
||||||
|
abi.encodeWithSelector;
|
||||||
|
abi.encodeWithSignature;
|
||||||
abi.decode;
|
abi.decode;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
contract C {
|
||||||
|
function f() public pure {
|
||||||
|
abi.encode;
|
||||||
|
abi.encodePacked;
|
||||||
|
abi.encodeWithSelector;
|
||||||
|
abi.encodeWithSignature;
|
||||||
|
abi.decode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// Warning: (52-62): Statement has no effect.
|
||||||
|
// Warning: (72-88): Statement has no effect.
|
||||||
|
// Warning: (98-120): Statement has no effect.
|
||||||
|
// Warning: (130-153): Statement has no effect.
|
||||||
|
// Warning: (163-173): Statement has no effect.
|
Loading…
Reference in New Issue
Block a user