diff options
author | bitshift <bitshift@posteo.org> | 2018-03-10 00:38:17 +0800 |
---|---|---|
committer | Erik Kundt <bitshift@posteo.org> | 2018-04-03 17:16:44 +0800 |
commit | 8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2 (patch) | |
tree | d7c39e5619dffb37bce2856daa1f9620493a1af5 /libsolidity/analysis/StaticAnalyzer.cpp | |
parent | 3bb54e8bd5ea75bd52d2eca43fd438f8e894a2de (diff) | |
download | dexon-solidity-8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2.tar dexon-solidity-8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2.tar.gz dexon-solidity-8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2.tar.bz2 dexon-solidity-8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2.tar.lz dexon-solidity-8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2.tar.xz dexon-solidity-8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2.tar.zst dexon-solidity-8fe1cfb12ef49a74eaebed56d160e88cfd9a4de2.zip |
Defaults to external visibility for interfaces.
Diffstat (limited to 'libsolidity/analysis/StaticAnalyzer.cpp')
-rw-r--r-- | libsolidity/analysis/StaticAnalyzer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/analysis/StaticAnalyzer.cpp b/libsolidity/analysis/StaticAnalyzer.cpp index 6aee260e..20464765 100644 --- a/libsolidity/analysis/StaticAnalyzer.cpp +++ b/libsolidity/analysis/StaticAnalyzer.cpp @@ -50,6 +50,14 @@ void StaticAnalyzer::endVisit(ContractDefinition const&) bool StaticAnalyzer::visit(FunctionDefinition const& _function) { + const bool isInterface = m_currentContract->contractKind() == ContractDefinition::ContractKind::Interface; + if (_function.noVisibilitySpecified()) + m_errorReporter.warning( + _function.location(), + "No visibility specified. Defaulting to \"" + + (isInterface ? "external" : Declaration::visibilityToString(_function.visibility())) + + "\"." + ); if (_function.isImplemented()) m_currentFunction = &_function; else |