aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorErik Kundt <bitshift@posteo.org>2018-03-29 00:10:32 +0800
committerErik Kundt <bitshift@posteo.org>2018-04-03 17:16:50 +0800
commitf9efa417492916546d23115da7a55e86090d47dd (patch)
tree163154bd1c147b9942923244aa09993f2dd0e45c /libsolidity
parent601659c3844767686a324ea363498e85320c92b1 (diff)
downloaddexon-solidity-f9efa417492916546d23115da7a55e86090d47dd.tar.gz
dexon-solidity-f9efa417492916546d23115da7a55e86090d47dd.tar.zst
dexon-solidity-f9efa417492916546d23115da7a55e86090d47dd.zip
Makes visibility warning more concise.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/StaticAnalyzer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libsolidity/analysis/StaticAnalyzer.cpp b/libsolidity/analysis/StaticAnalyzer.cpp
index 20464765..d96f8748 100644
--- a/libsolidity/analysis/StaticAnalyzer.cpp
+++ b/libsolidity/analysis/StaticAnalyzer.cpp
@@ -51,12 +51,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())) +
- "\"."
+ Declaration::visibilityToString(_function.visibility()) +
+ "\". " +
+ (isInterface ? "In interfaces it defaults to external." : "")
);
if (_function.isImplemented())
m_currentFunction = &_function;