mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow trailing comma in Enum Declaration
This commit is contained in:
parent
bb30e9184b
commit
850350e7bc
@ -731,6 +731,20 @@ BOOST_AUTO_TEST_CASE(empty_enum_declaration)
|
|||||||
BOOST_CHECK_NO_THROW(parseTextExplainError(text));
|
BOOST_CHECK_NO_THROW(parseTextExplainError(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(malformed_enum_declaration)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
|
contract c {
|
||||||
|
enum foo { WARNING,};
|
||||||
|
function c ()
|
||||||
|
{
|
||||||
|
a = foo.CRITICAL;
|
||||||
|
}
|
||||||
|
uint256 a;
|
||||||
|
})";
|
||||||
|
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user