solidity/test/libsolidity/semanticTests/viaYul/conditional/conditional_tuple.sol

13 lines
252 B
Solidity
Raw Normal View History

2020-02-13 19:42:16 +00:00
contract A {
function f(bool cond) public pure returns (uint, uint) {
(uint a, uint b) = cond ? (1, 2) : (3, 4);
return (a, b);
}
}
// ====
// compileToEwasm: also
// compileViaYul: also
2020-02-13 19:42:16 +00:00
// ----
// f(bool): true -> 1, 2
// f(bool): false -> 3, 4