mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[Sol->Yul] Implementing struct copying from calldata to storage
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
uint256 a;
|
||||
uint256 b;
|
||||
bytes2 c;
|
||||
}
|
||||
|
||||
S s;
|
||||
|
||||
function f(uint32 a, S calldata c, uint256 b) external returns (uint256, uint256, byte) {
|
||||
s = c;
|
||||
return (s.a, s.b, s.c[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// ----
|
||||
// f(uint32, (uint256, uint256, bytes2), uint256): 1, 42, 23, "ab", 1 -> 42, 23, "b"
|
||||
Reference in New Issue
Block a user