solidity/test/libsolidity/semanticTests/abiEncoderV2/enums.sol

17 lines
375 B
Solidity
Raw Normal View History

2020-11-23 18:06:44 +00:00
pragma abicoder v2;
2020-11-03 10:33:16 +00:00
contract C {
enum E { A, B }
function f(E e) public pure returns (uint x) {
assembly { x := e }
}
}
// ====
// compileToEwasm: also
// compileViaYul: also
2020-11-03 10:33:16 +00:00
// ----
// f(uint8): 0 -> 0
// f(uint8): 1 -> 1
// f(uint8): 2 -> FAILURE
// f(uint8): 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -> FAILURE