aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2017-06-17 23:21:46 +0800
committerFederico Bond <federicobond@gmail.com>2017-06-17 23:21:46 +0800
commitd170ceaf3d8f63536a730ccc6388183a7a483514 (patch)
tree3c91cb2455eae5fd5faeea8658a4e2ae259e4ae2 /libsolidity
parente0b9589e5a5b961541aefe783045b93fac347773 (diff)
downloaddexon-solidity-d170ceaf3d8f63536a730ccc6388183a7a483514.tar.gz
dexon-solidity-d170ceaf3d8f63536a730ccc6388183a7a483514.tar.zst
dexon-solidity-d170ceaf3d8f63536a730ccc6388183a7a483514.zip
Display error if payable or constant is specified multiple times
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/parsing/Parser.cpp6
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();
}