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/parsing/Parser.cpp | |
parent | d64e93332704ade6cc2078c0c37956e1c9e8af9e (diff) | |
download | dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar.gz dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.tar.zst dexon-solidity-2ad1acaf721072d27783d586048d6377be6c3f99.zip |
Warn if modifiers are applied to functions without implementation.
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index bdb46ad6..ea092a74 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -365,12 +365,12 @@ Parser::FunctionHeaderParserResult Parser::parseFunctionHeader( Token::Value token = m_scanner->currentToken(); if (_allowModifiers && token == Token::Identifier) { - // This can either be a modifier (function declaration) or the name of the - // variable (function type name plus variable). - if ( + // If the name is empty, then this can either be a modifier (fallback function declaration) + // or the name of the state variable (function type name plus variable). + if (result.name->empty() && ( m_scanner->peekNextToken() == Token::Semicolon || m_scanner->peekNextToken() == Token::Assign - ) + )) // Variable declaration, break here. break; else |