mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
03f58c6b52
Explicit conversions between literals and enums are only allowed if the literal can represent a value in the enum.
11 lines
195 B
Solidity
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;
|
|
}
|
|
}
|
|
// ----
|