aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/StaticAnalyzer.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-04-03 22:15:36 +0800
committerGitHub <noreply@github.com>2018-04-03 22:15:36 +0800
commit7753249f646f239819c62ab6847438dc84b6e04b (patch)
treeb209000917d198d897d078c0eb7ecf47d704bf30 /libsolidity/analysis/StaticAnalyzer.cpp
parent19f288774112c64331b55aca0f6519452dea2c74 (diff)
parentf9efa417492916546d23115da7a55e86090d47dd (diff)
downloaddexon-solidity-7753249f646f239819c62ab6847438dc84b6e04b.tar.gz
dexon-solidity-7753249f646f239819c62ab6847438dc84b6e04b.tar.zst
dexon-solidity-7753249f646f239819c62ab6847438dc84b6e04b.zip
Merge pull request #3699 from ethereum/interfaceExternalVisibility
Defaults to external visibility for interfaces.
Diffstat (limited to 'libsolidity/analysis/StaticAnalyzer.cpp')
-rw-r--r--libsolidity/analysis/StaticAnalyzer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/analysis/StaticAnalyzer.cpp b/libsolidity/analysis/StaticAnalyzer.cpp
index 6aee260e..d96f8748 100644
--- a/libsolidity/analysis/StaticAnalyzer.cpp
+++ b/libsolidity/analysis/StaticAnalyzer.cpp
@@ -50,6 +50,16 @@ 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 \"" +
+ Declaration::visibilityToString(_function.visibility()) +
+ "\". " +
+ (isInterface ? "In interfaces it defaults to external." : "")
+ );
if (_function.isImplemented())
m_currentFunction = &_function;
else