diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-01 00:42:46 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-01 18:28:00 +0800 |
commit | b545987ec7916209f0a1dfe196d78b49cdf2ddae (patch) | |
tree | b3a2872738768ae7fdbf4190b2587b206a21f936 /libsolidity/analysis | |
parent | cc1c461fc05255f0efc3a36f6c90336092c66aae (diff) | |
download | dexon-solidity-b545987ec7916209f0a1dfe196d78b49cdf2ddae.tar.gz dexon-solidity-b545987ec7916209f0a1dfe196d78b49cdf2ddae.tar.zst dexon-solidity-b545987ec7916209f0a1dfe196d78b49cdf2ddae.zip |
Issue warning for using public visibility for interface functions
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 191f78e9..d67142e4 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -604,6 +604,8 @@ bool TypeChecker::visit(FunctionDefinition const& _function) { if (_function.visibility() < FunctionDefinition::Visibility::Public) m_errorReporter.typeError(_function.location(), "Functions in interfaces cannot be internal or private."); + else if (_function.visibility() != FunctionDefinition::Visibility::External) + m_errorReporter.warning(_function.location(), "Functions in interfaces should be declared external."); } if (_function.isConstructor()) m_errorReporter.typeError(_function.location(), "Constructor cannot be defined in interfaces."); |