mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add test for multiple visibilites on functions
This commit is contained in:
parent
a4e39592c7
commit
a8ca623a0f
@ -354,7 +354,7 @@ Parser::FunctionHeaderParserResult Parser::parseFunctionHeader(bool _forceEmptyN
|
|||||||
{
|
{
|
||||||
if (result.visibility != Declaration::Visibility::Default)
|
if (result.visibility != Declaration::Visibility::Default)
|
||||||
{
|
{
|
||||||
parserError(string("Multiple visibility specifiers."));
|
parserError(string("Visibility already specified."));
|
||||||
m_scanner->next();
|
m_scanner->next();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -898,7 +898,12 @@ BOOST_AUTO_TEST_CASE(multiple_visibility_specifiers)
|
|||||||
contract c {
|
contract c {
|
||||||
uint private internal a;
|
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)
|
BOOST_AUTO_TEST_CASE(multiple_payable_specifiers)
|
||||||
|
Loading…
Reference in New Issue
Block a user