Disallow unary plus at the parsing stage

This commit is contained in:
Kamil Śliwak
2023-04-18 16:47:00 +02:00
parent ee1b50d345
commit 8a14680851
9 changed files with 27 additions and 20 deletions
+1 -3
View File
@@ -332,9 +332,7 @@ bool SyntaxChecker::visit(Literal const& _literal)
bool SyntaxChecker::visit(UnaryOperation const& _operation)
{
if (_operation.getOperator() == Token::Add)
m_errorReporter.syntaxError(9636_error, _operation.location(), "Use of unary + is disallowed.");
solAssert(_operation.getOperator() != Token::Add);
return true;
}