solidity/test/libsolidity/semanticTests/smoke/structs.sol

25 lines
430 B
Solidity
Raw Normal View History

pragma experimental ABIEncoderV2;
contract C {
struct S {
uint a;
uint b;
}
struct T {
uint a;
uint b;
string s;
}
function s() public returns (S memory) {
return S(23, 42);
}
function t() public returns (T memory) {
return T(23, 42, "any");
}
}
2020-07-20 13:06:45 +00:00
// ====
// compileViaYul: also
// ----
// s() -> 23, 42
// t() -> 0x20, 23, 42, 0x60, 3, "any"