diff options
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 2 | ||||
-rw-r--r-- | test/libsolidity/SolidityParser.cpp | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index bc004d14..d1f9c1fa 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -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 diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 78edd4d1..d7ada518 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -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) |