Make visibility optional, but it has to be consistent.

This commit is contained in:
chriseth
2020-07-07 12:16:18 +02:00
parent 479d7a059f
commit 5959d442cb
13 changed files with 78 additions and 15 deletions
+1 -7
View File
@@ -301,13 +301,7 @@ bool SyntaxChecker::visit(ContractDefinition const& _contract)
bool SyntaxChecker::visit(FunctionDefinition const& _function)
{
if (_function.isConstructor() && !_function.noVisibilitySpecified())
m_errorReporter.syntaxError(
2462_error,
_function.location(),
"Visibility specified for constructor. If you want the contract to be non-deployable, make it \"abstract\"."
);
else if (!_function.isConstructor() && _function.noVisibilitySpecified())
if (!_function.isConstructor() && _function.noVisibilitySpecified())
{
string suggestedVisibility = _function.isFallback() || _function.isReceive() || m_isInterface ? "external" : "public";
m_errorReporter.syntaxError(