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

16 lines
354 B
Solidity
Raw Normal View History

pragma abicoder v1;
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 }
}
}
// ====
// ABIEncoderV1Only: true
// compileViaYul: false
2020-11-03 10:33:16 +00:00
// ----
// f(uint8): 0 -> 0
// f(uint8): 1 -> 1
// f(uint8): 2 -> 2
// f(uint8): 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -> 0xff