diff options
author | chriseth <chris@ethereum.org> | 2018-03-16 19:39:30 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-04-12 04:00:21 +0800 |
commit | 2ad1acaf721072d27783d586048d6377be6c3f99 (patch) | |
tree | 6b3454a46ff67e2c68e424b4d437fd96cb1c7a02 /libsolidity/analysis | |
parent | d64e93332704ade6cc2078c0c37956e1c9e8af9e (diff) | |
download | dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar.gz dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar.bz2 dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar.lz dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar.xz dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar.zst dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.zip |
Warn if modifiers are applied to functions without implementation.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/SyntaxChecker.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index 343b4ba8..f648e5b4 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -232,6 +232,13 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function) "Use \"constructor(...) { ... }\" instead." ); } + if (!_function.isImplemented() && !_function.modifiers().empty()) + { + if (v050) + m_errorReporter.syntaxError(_function.location(), "Functions without implementation cannot have modifiers."); + else + m_errorReporter.warning( _function.location(), "Modifiers of functions without implementation are ignored." ); + } return true; } |