solidity/test/libsolidity/semanticTests/tryCatch/assert.sol
Daniel Kirchner a8f7c69c47 Adjust tests.
2021-09-13 20:41:40 +02:00

20 lines
421 B
Solidity

contract C {
function g(bool x) public pure {
assert(x);
}
function f(bool x) public returns (uint) {
// Set the gas to make this work on pre-byzantium VMs
try this.g{gas: 8000}(x) {
return 1;
} catch {
return 2;
}
}
}
// ====
// requiresYulOptimizer: minimalStack
// compileViaYul: also
// ----
// f(bool): true -> 1
// f(bool): false -> 2