mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Enum Value member access should now work properly
- Also detection of duplicate enum values and tests for them have been added
This commit is contained in:
parent
fe725fbb49
commit
3dd00cbdd8
@ -1056,6 +1056,23 @@ BOOST_AUTO_TEST_CASE(enum_implicit_conversion_is_not_okay)
|
||||
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(enum_duplicate_values)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
enum ActionChoices { GoLeft, GoRight, GoLeft, Sit };
|
||||
function test()
|
||||
{
|
||||
a = 1;
|
||||
b = 2;
|
||||
}
|
||||
uint256 a;
|
||||
uint64 b;
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user