mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Anything outside storage is always a pointer.
This commit is contained in:
committed by
chriseth
parent
148b87c977
commit
fe659ceb41
@@ -54,7 +54,7 @@
|
||||
"storageLocation": "memory",
|
||||
"typeDescriptions":
|
||||
{
|
||||
"typeIdentifier": "t_array$_t_array$_t_uint256_$dyn_memory_$dyn_memory_ptr",
|
||||
"typeIdentifier": "t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr",
|
||||
"typeString": "uint256[][]"
|
||||
},
|
||||
"typeName":
|
||||
|
||||
@@ -14,9 +14,9 @@ contract C {
|
||||
}
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 1120000
|
||||
// executionCost: 1160
|
||||
// totalCost: 1121160
|
||||
// codeDepositCost: 1094400
|
||||
// executionCost: 1134
|
||||
// totalCost: 1095534
|
||||
// external:
|
||||
// a(): 1130
|
||||
// b(uint256): infinite
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
struct S { uint256 v; string s; }
|
||||
|
||||
contract A
|
||||
{
|
||||
function test() external virtual returns (uint256 v, string memory s)
|
||||
{
|
||||
v = 42;
|
||||
s = "test";
|
||||
}
|
||||
}
|
||||
contract X is A
|
||||
{
|
||||
S public override test;
|
||||
|
||||
function set() public { test.v = 2; test.s = "statevar"; }
|
||||
}
|
||||
|
||||
|
||||
// ----
|
||||
// test() -> 0, 64, 0
|
||||
// set() ->
|
||||
// test() -> 2, 0x40, 8, "statevar"
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
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"
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
abstract contract C {
|
||||
struct S {
|
||||
uint256 x;
|
||||
string y;
|
||||
}
|
||||
function f(address x) external virtual returns (uint256, string memory);
|
||||
}
|
||||
contract D is C {
|
||||
mapping(address => S) public override f;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
abstract contract C {
|
||||
struct S {
|
||||
uint256 x;
|
||||
string y;
|
||||
}
|
||||
|
||||
function f() external virtual returns (uint256, string memory);
|
||||
}
|
||||
contract D is C {
|
||||
S public override f;
|
||||
}
|
||||
Reference in New Issue
Block a user