mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
670b719773
Co-Authored-By: Bhargava Shastry <bhargava.shastry@ethereum.org>
17 lines
351 B
Solidity
17 lines
351 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;
|
|
}
|
|
}
|
|
}
|
|
// ----
|
|
// f(bool): true -> 1
|
|
// f(bool): false -> 2
|