Merge pull request #7442 from ethereum/develop

Merge develop into develop_060
This commit is contained in:
chriseth
2019-09-17 12:16:27 +02:00
committed by GitHub
44 changed files with 764 additions and 229 deletions
@@ -0,0 +1,39 @@
contract C {
mapping (uint => uint)[][] a;
function n1(uint key, uint value) public {
a.length++;
mapping (uint => uint)[] storage b = a[a.length - 1];
b.length++;
b[b.length - 1][key] = value;
}
function n2() public {
a.length++;
mapping (uint => uint)[] storage b = a[a.length - 1];
b.length++;
}
function map(uint key) public view returns (uint) {
mapping (uint => uint)[] storage b = a[a.length - 1];
return b[b.length - 1][key];
}
function p() public {
a.pop();
}
function d() public returns (uint) {
delete a;
return a.length;
}
}
// ----
// n1(uint256,uint256): 42, 64 ->
// map(uint256): 42 -> 64
// p() ->
// n2() ->
// map(uint256): 42 -> 64
// d() -> 0
// n2() ->
// map(uint256): 42 -> 64
@@ -0,0 +1,34 @@
contract C {
mapping (uint => uint)[] a;
function n1(uint key, uint value) public {
a.length++;
a[a.length - 1][key] = value;
}
function n2() public {
a.length++;
}
function map(uint key) public view returns (uint) {
return a[a.length - 1][key];
}
function p() public {
a.pop();
}
function d() public returns (uint) {
delete a;
return a.length;
}
}
// ----
// n1(uint256,uint256): 42, 64 ->
// map(uint256): 42 -> 64
// p() ->
// n2() ->
// map(uint256): 42 -> 64
// d() -> 0
// n2() ->
// map(uint256): 42 -> 64