solidity/test/libsolidity/semanticTests/reverts/error_struct.sol

19 lines
328 B
Solidity
Raw Normal View History

2021-01-28 11:56:22 +00:00
struct error { uint error; }
contract C {
error test();
error _struct;
function f() public {
revert test();
}
function g(uint x) public returns (uint) {
_struct.error = x;
return _struct.error;
}
}
// ====
// compileViaYul: also
2021-04-23 15:59:01 +00:00
// compileToEwasm: also
2021-01-28 11:56:22 +00:00
// ----
// f() -> FAILURE, hex"f8a8fd6d"
// g(uint256): 7 -> 7