mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Removed specialized errors related to constant state mutability
This commit is contained in:
@@ -464,14 +464,6 @@ StateMutability Parser::parseStateMutability()
|
||||
case Token::Pure:
|
||||
stateMutability = StateMutability::Pure;
|
||||
break;
|
||||
case Token::Constant:
|
||||
stateMutability = StateMutability::View;
|
||||
parserError(
|
||||
7698_error,
|
||||
"The state mutability modifier \"constant\" was removed in version 0.5.0. "
|
||||
"Use \"view\" or \"pure\" instead."
|
||||
);
|
||||
break;
|
||||
default:
|
||||
solAssert(false, "Invalid state mutability specifier.");
|
||||
}
|
||||
@@ -997,7 +989,7 @@ ASTPointer<TypeName> Parser::parseTypeName(bool _allowVar)
|
||||
auto stateMutability = elemTypeName.token() == Token::Address
|
||||
? optional<StateMutability>{StateMutability::NonPayable}
|
||||
: nullopt;
|
||||
if (TokenTraits::isStateMutabilitySpecifier(m_scanner->currentToken(), false))
|
||||
if (TokenTraits::isStateMutabilitySpecifier(m_scanner->currentToken()))
|
||||
{
|
||||
if (elemTypeName.token() == Token::Address)
|
||||
{
|
||||
@@ -2065,7 +2057,7 @@ Parser::LookAheadInfo Parser::peekStatementType() const
|
||||
// kind of statement. This means, for example, that we do not allow type expressions of the form
|
||||
// ``address payable;``.
|
||||
// If we want to change this in the future, we need to consider another scanner token here.
|
||||
if (TokenTraits::isElementaryTypeName(token) && TokenTraits::isStateMutabilitySpecifier(next, false))
|
||||
if (TokenTraits::isElementaryTypeName(token) && TokenTraits::isStateMutabilitySpecifier(next))
|
||||
return LookAheadInfo::VariableDeclaration;
|
||||
if (next == Token::Identifier || TokenTraits::isLocationSpecifier(next))
|
||||
return LookAheadInfo::VariableDeclaration;
|
||||
|
||||
Reference in New Issue
Block a user