Implementing struct copying from calldata to storage

This commit is contained in:
Djordje Mijovic
2020-09-02 12:28:53 +02:00
parent 762e3f3cee
commit 23f6369a46
4 changed files with 50 additions and 46 deletions
@@ -3,10 +3,11 @@ pragma experimental ABIEncoderV2;
contract C {
struct S {
uint256 a;
uint256 b;
uint64 b;
bytes2 c;
}
uint[153] r;
S s;
function f(uint32 a, S calldata c, uint256 b) external returns (uint256, uint256, byte) {
@@ -16,6 +17,6 @@ contract C {
}
// ====
// compileViaYul: true
// compileViaYul: also
// ----
// f(uint32, (uint256, uint256, bytes2), uint256): 1, 42, 23, "ab", 1 -> 42, 23, "b"
// f(uint32, (uint256, uint64, bytes2), uint256): 1, 42, 23, "ab", 1 -> 42, 23, "b"