mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
25 lines
409 B
Solidity
25 lines
409 B
Solidity
pragma abicoder v2;
|
|
// Example from https://github.com/ethereum/solidity/issues/12558
|
|
struct S {
|
|
uint x;
|
|
}
|
|
|
|
contract C {
|
|
S sStorage;
|
|
constructor() {
|
|
sStorage.x = 13;
|
|
}
|
|
|
|
function f() external returns (S[] memory) {
|
|
S[] memory sMemory = new S[](1);
|
|
|
|
sMemory[0] = sStorage;
|
|
|
|
return sMemory;
|
|
}
|
|
}
|
|
// ====
|
|
// compileViaYul: also
|
|
// ----
|
|
// f() -> 0x20, 1, 13
|