solidity/test/libsolidity/syntaxTests/enums/literal_conversion.sol
hrkrshnn 03f58c6b52 Strict explicit conversion between literals and enums
Explicit conversions between literals and enums are only allowed if the literal can represent a
value in the enum.
2020-11-06 19:15:02 +01:00

11 lines
195 B
Solidity

contract C {
enum Test { One, Two }
function f() public pure {
Test a = Test(0);
Test b = Test(1);
Test c = Test(type(uint).max);
a; b; c;
}
}
// ----