mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
19 lines
340 B
Solidity
19 lines
340 B
Solidity
contract C {
|
|
function g(bool x) external pure {
|
|
require(x);
|
|
}
|
|
function f(bool x) public returns (uint) {
|
|
try this.g(x) {
|
|
return 1;
|
|
} catch {
|
|
return 2;
|
|
}
|
|
}
|
|
}
|
|
// ====
|
|
// EVMVersion: >=byzantium
|
|
// compileViaYul: also
|
|
// ----
|
|
// f(bool): true -> 1
|
|
// f(bool): false -> 2
|