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

20 lines
350 B
Solidity

contract test {
enum ActionChoices {GoLeft, GoRight, GoStraight, Sit}
constructor() {
choices = ActionChoices.GoStraight;
}
function getChoice() public returns (uint256 d) {
d = uint256(choices);
}
ActionChoices choices;
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// getChoice() -> 2