New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate use of unary '+' #2199

Merged
merged 2 commits into from May 2, 2017

Conversation

Projects
None yet
4 participants
@roadriverrail
Collaborator

roadriverrail commented Apr 29, 2017

The unary '+' serves no meaningful purpose in Solidity and it makes it
possible to produce typos with dagerous implications (e.g. 'a =+5 '),
so we are deprecating it. The SyntaxChecker currently issues warnings
on the unary '+' but will still compile it for now.

This PR resolves issue #1760

Deprecate use of unary '+'
The unary '+' serves no meaningful purpose in Solidity and it makes it
possible to produce typos with dagerous implications (e.g. 'a =+5 '),
so we are deprecating it.  The SyntaxChecker currently issues warnings
on the unary '+' but will still compile it for now.
@@ -32,6 +32,16 @@ bool SyntaxChecker::checkSyntax(ASTNode const& _astRoot)
return Error::containsOnlyWarnings(m_errors);
}
void SyntaxChecker::warning(SourceLocation const& _location, string const& _description)

This comment has been minimized.

@axic

axic May 1, 2017

Member

We should figure out a way to have a helper for this. I think we have this duplicated in every single file almost by now.

@axic

axic May 1, 2017

Member

We should figure out a way to have a helper for this. I think we have this duplicated in every single file almost by now.

This comment has been minimized.

@roadriverrail

roadriverrail May 1, 2017

Collaborator

Agreed. I'm a fan of keeping refactoring commits separate from feature commits, so if it's okay, I'll work on a helper class in a separate pull request.

@roadriverrail

roadriverrail May 1, 2017

Collaborator

Agreed. I'm a fan of keeping refactoring commits separate from feature commits, so if it's okay, I'll work on a helper class in a separate pull request.

@chriseth chriseth added the nextrelease label May 2, 2017

@axic

axic approved these changes May 2, 2017

@chriseth chriseth merged commit acab525 into ethereum:develop May 2, 2017

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@chriseth chriseth referenced this pull request May 3, 2017

Closed

Warn about unary plus #1759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment