solidity/test/libsolidity/semanticTests/tryCatch/simple_notuple.sol
2022-05-19 20:23:28 +02:00

19 lines
376 B
Solidity

contract C {
function g(bool b) public pure returns (uint x) {
require(b);
return 13;
}
function f(bool flag) public view returns (uint x) {
try this.g(flag) returns (uint a) {
x = a;
} catch {
x = 9;
}
}
}
// ====
// EVMVersion: >=byzantium
// ----
// f(bool): true -> 13
// f(bool): false -> 9