solidity/test/libsolidity/semanticTests/intheritance/overloaded_function_call_with_if_else.sol
2020-03-19 14:42:25 +01:00

21 lines
400 B
Solidity

contract test {
function f(uint256 a, uint256 b) public returns (uint256 d) {
return a + b;
}
function f(uint256 k) public returns (uint256 d) {
return k;
}
function g(bool flag) public returns (uint256 d) {
if (flag) return f(3);
else return f(3, 7);
}
}
// ====
// compileViaYul: also
// ----
// g(bool): true -> 3
// g(bool): false -> 10