mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Unary + now a synax error (experimental 0.5.0)
The unary + was deprecated with a warning, but will be elevated to an error in 0.5.0. This adds the syntax error for the 0.5.0 pragma, and for a true 0.5.0 release we should consider removing the operator from the parser.
This commit is contained in:
committed by
Alex Beregszaszi
parent
466cce58df
commit
e434437eb7
@@ -182,8 +182,15 @@ bool SyntaxChecker::visit(Throw const& _throwStatement)
|
||||
|
||||
bool SyntaxChecker::visit(UnaryOperation const& _operation)
|
||||
{
|
||||
bool const v050 = m_sourceUnit->annotation().experimentalFeatures.count(ExperimentalFeature::V050);
|
||||
|
||||
if (_operation.getOperator() == Token::Add)
|
||||
m_errorReporter.warning(_operation.location(), "Use of unary + is deprecated.");
|
||||
{
|
||||
if (v050)
|
||||
m_errorReporter.syntaxError(_operation.location(), "Use of unary + is deprecated.");
|
||||
else
|
||||
m_errorReporter.warning(_operation.location(), "Use of unary + is deprecated.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user