Add test for multiple visibilites on functions

This commit is contained in:
Alex Beregszaszi 2017-08-09 13:22:19 +01:00
parent a4e39592c7
commit a8ca623a0f
2 changed files with 7 additions and 2 deletions

View File

@ -354,7 +354,7 @@ Parser::FunctionHeaderParserResult Parser::parseFunctionHeader(bool _forceEmptyN
{
if (result.visibility != Declaration::Visibility::Default)
{
parserError(string("Multiple visibility specifiers."));
parserError(string("Visibility already specified."));
m_scanner->next();
}
else

View File

@ -898,7 +898,12 @@ BOOST_AUTO_TEST_CASE(multiple_visibility_specifiers)
contract c {
uint private internal a;
})";
CHECK_PARSE_ERROR(text, "Visibility already specified");
CHECK_PARSE_ERROR(text, "Visibility already specified.");
text = R"(
contract c {
function f() private external {}
})";
CHECK_PARSE_ERROR(text, "Visibility already specified.");
}
BOOST_AUTO_TEST_CASE(multiple_payable_specifiers)