solidity/test/libsolidity/semanticTests/abiEncoderV2/enums.sol
2023-05-11 10:56:55 -05:00

14 lines
320 B
Solidity

pragma abicoder v2;
contract C {
enum E { A, B }
function f(E e) public pure returns (uint x) {
assembly { x := e }
}
}
// ----
// f(uint8): 0 -> 0
// f(uint8): 1 -> 1
// f(uint8): 2 -> FAILURE
// f(uint8): 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -> FAILURE