mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
27 lines
500 B
Solidity
27 lines
500 B
Solidity
|
pragma experimental ABIEncoderV2;
|
||
|
|
||
|
struct S { uint256 v; string s; }
|
||
|
|
||
|
contract A
|
||
|
{
|
||
|
function test(uint256 x) external virtual returns (uint256 v, string memory s)
|
||
|
{
|
||
|
v = x;
|
||
|
s = "test";
|
||
|
}
|
||
|
}
|
||
|
contract X is A
|
||
|
{
|
||
|
mapping(uint256 => S) public override test;
|
||
|
|
||
|
function set() public { test[42].v = 2; test[42].s = "statevar"; }
|
||
|
}
|
||
|
|
||
|
|
||
|
// ----
|
||
|
// test(uint256): 0 -> 0, 64, 0
|
||
|
// test(uint256): 42 -> 0, 64, 0
|
||
|
// set() ->
|
||
|
// test(uint256): 0 -> 0, 64, 0
|
||
|
// test(uint256): 42 -> 2, 0x40, 8, "statevar"
|