solidity/test/libsolidity/syntaxTests/nameAndTypeResolution/129_int_to_enum_explicit_conversion_is_okay.sol

12 lines
349 B
Solidity
Raw Normal View History

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