aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorRhett Aultman <roadriverrail@gmail.com>2017-04-29 08:43:19 +0800
committerRhett Aultman <roadriverrail@gmail.com>2017-04-29 08:43:19 +0800
commite544698ad3a2101e3d910d0761571d4fa20144e8 (patch)
tree05195e18c017d61f873a74b3fbc28fdea969b30e /test/libsolidity
parentf33614e1f7c85126b8f1a6d007f5824f6dce237d (diff)
downloaddexon-solidity-e544698ad3a2101e3d910d0761571d4fa20144e8.tar.gz
dexon-solidity-e544698ad3a2101e3d910d0761571d4fa20144e8.tar.zst
dexon-solidity-e544698ad3a2101e3d910d0761571d4fa20144e8.zip
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.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index f88f600a..8e80e006 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3938,12 +3938,21 @@ BOOST_AUTO_TEST_CASE(rational_unary_operation)
char const* text = R"(
contract test {
function f() {
- ufixed8x16 a = +3.25;
+ ufixed8x16 a = 3.25;
fixed8x16 b = -3.25;
}
}
)";
CHECK_SUCCESS(text);
+ text = R"(
+ contract test {
+ function f() {
+ ufixed8x16 a = +3.25;
+ fixed8x16 b = -3.25;
+ }
+ }
+ )";
+ CHECK_WARNING(text,"Use of unary + is deprecated");
}
BOOST_AUTO_TEST_CASE(leading_zero_rationals_convert)