solidity/test/libsolidity/syntaxTests/nameAndTypeResolution/128_enum_explicit_conversion_is_okay.sol

12 lines
383 B
Solidity
Raw Normal View History

contract test {
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
function test() public {
a = uint256(ActionChoices.GoStraight);
b = uint64(ActionChoices.Sit);
}
uint256 a;
uint64 b;
}
// ----
// Warning: (80-196): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.