diff options
author | chriseth <chris@ethereum.org> | 2017-06-19 18:00:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 18:00:04 +0800 |
commit | b3a7b5a145ba66e5ce99c04cc99418e995543355 (patch) | |
tree | a8149862e6a8e009948e9b37af1deb6fdf8f7ca0 /libsolidity | |
parent | 0c75afb2c1b9c8e81295c76aa1caa2a48b239aaf (diff) | |
parent | d170ceaf3d8f63536a730ccc6388183a7a483514 (diff) | |
download | dexon-solidity-b3a7b5a145ba66e5ce99c04cc99418e995543355.tar dexon-solidity-b3a7b5a145ba66e5ce99c04cc99418e995543355.tar.gz dexon-solidity-b3a7b5a145ba66e5ce99c04cc99418e995543355.tar.bz2 dexon-solidity-b3a7b5a145ba66e5ce99c04cc99418e995543355.tar.lz dexon-solidity-b3a7b5a145ba66e5ce99c04cc99418e995543355.tar.xz dexon-solidity-b3a7b5a145ba66e5ce99c04cc99418e995543355.tar.zst dexon-solidity-b3a7b5a145ba66e5ce99c04cc99418e995543355.zip |
Merge pull request #2416 from federicobond/multiple-specifiers
Display error if payable or constant is specified multiple times
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 88b41f20..ec6d11f4 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -323,11 +323,17 @@ Parser::FunctionHeaderParserResult Parser::parseFunctionHeader(bool _forceEmptyN Token::Value token = m_scanner->currentToken(); if (token == Token::Const) { + if (result.isDeclaredConst) + parserError(string("Multiple \"constant\" specifiers.")); + result.isDeclaredConst = true; m_scanner->next(); } else if (m_scanner->currentToken() == Token::Payable) { + if (result.isPayable) + parserError(string("Multiple \"payable\" specifiers.")); + result.isPayable = true; m_scanner->next(); } |