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

12 lines
253 B
Solidity

contract test {
function f(bool cond) public pure returns (uint256) {
uint32 x = 0x1234_ab;
uint256 y = 0x1234_abcd_1234;
return cond ? x : y;
}
}
// ----
// f(bool): true -> 0x1234ab
// f(bool): false -> 0x1234abcd1234