Merge pull request #2416 from federicobond/multiple-specifiers

Display error if payable or constant is specified multiple times
This commit is contained in:
chriseth
2017-06-19 12:00:04 +02:00
committed by GitHub
2 changed files with 24 additions and 0 deletions
+18
View File
@@ -901,6 +901,24 @@ BOOST_AUTO_TEST_CASE(multiple_visibility_specifiers)
CHECK_PARSE_ERROR(text, "Visibility already specified");
}
BOOST_AUTO_TEST_CASE(multiple_payable_specifiers)
{
char const* text = R"(
contract c {
function f() payable payable {}
})";
CHECK_PARSE_ERROR(text, "Multiple \"payable\" specifiers.");
}
BOOST_AUTO_TEST_CASE(multiple_constant_specifiers)
{
char const* text = R"(
contract c {
function f() constant constant {}
})";
CHECK_PARSE_ERROR(text, "Multiple \"constant\" specifiers.");
}
BOOST_AUTO_TEST_CASE(literal_constants_with_ether_subdenominations)
{
char const* text = R"(