From d170ceaf3d8f63536a730ccc6388183a7a483514 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Sat, 17 Jun 2017 12:21:46 -0300 Subject: Display error if payable or constant is specified multiple times --- libsolidity/parsing/Parser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libsolidity/parsing/Parser.cpp') 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(); } -- cgit