mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Makes visibility warning more concise.
This commit is contained in:
parent
601659c384
commit
f9efa41749
@ -51,12 +51,14 @@ void StaticAnalyzer::endVisit(ContractDefinition const&)
|
|||||||
bool StaticAnalyzer::visit(FunctionDefinition const& _function)
|
bool StaticAnalyzer::visit(FunctionDefinition const& _function)
|
||||||
{
|
{
|
||||||
const bool isInterface = m_currentContract->contractKind() == ContractDefinition::ContractKind::Interface;
|
const bool isInterface = m_currentContract->contractKind() == ContractDefinition::ContractKind::Interface;
|
||||||
|
|
||||||
if (_function.noVisibilitySpecified())
|
if (_function.noVisibilitySpecified())
|
||||||
m_errorReporter.warning(
|
m_errorReporter.warning(
|
||||||
_function.location(),
|
_function.location(),
|
||||||
"No visibility specified. Defaulting to \"" +
|
"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())
|
if (_function.isImplemented())
|
||||||
m_currentFunction = &_function;
|
m_currentFunction = &_function;
|
||||||
|
@ -3,4 +3,4 @@ interface I {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: Functions in interfaces should be declared external.
|
// Warning: Functions in interfaces should be declared external.
|
||||||
// Warning: No visibility specified. Defaulting to "external".
|
// Warning: No visibility specified. Defaulting to "public". In interfaces it defaults to external.
|
||||||
|
Loading…
Reference in New Issue
Block a user