diff options
author | chriseth <chris@ethereum.org> | 2017-05-02 22:43:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 22:43:47 +0800 |
commit | acab525fefe37f2c02478c79399d5c79e211434e (patch) | |
tree | 927dd8db8e5204452839da8e983d5457b6c7a935 /test | |
parent | 084ab4123f3b00ffba49f3ac5edcc58e0d79f0fb (diff) | |
parent | 96870686a9aba46a14d659c8c1cd107a9071857f (diff) | |
download | dexon-solidity-acab525fefe37f2c02478c79399d5c79e211434e.tar dexon-solidity-acab525fefe37f2c02478c79399d5c79e211434e.tar.gz dexon-solidity-acab525fefe37f2c02478c79399d5c79e211434e.tar.bz2 dexon-solidity-acab525fefe37f2c02478c79399d5c79e211434e.tar.lz dexon-solidity-acab525fefe37f2c02478c79399d5c79e211434e.tar.xz dexon-solidity-acab525fefe37f2c02478c79399d5c79e211434e.tar.zst dexon-solidity-acab525fefe37f2c02478c79399d5c79e211434e.zip |
Merge pull request #2199 from roadriverrail/no_unary_plus
Deprecate use of unary '+'
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index f88f600a..90d0e728 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -3938,12 +3938,29 @@ BOOST_AUTO_TEST_CASE(rational_unary_operation) char const* text = R"( contract test { function f() { + ufixed8x16 a = 3.25; + fixed8x16 b = -3.25; + } + } + )"; + CHECK_SUCCESS_NO_WARNINGS(text); + text = R"( + contract test { + function f() { ufixed8x16 a = +3.25; fixed8x16 b = -3.25; } } )"; - CHECK_SUCCESS(text); + CHECK_WARNING(text,"Use of unary + is deprecated"); + text = R"( + contract test { + function f(uint x) { + uint y = +x; + } + } + )"; + CHECK_WARNING(text,"Use of unary + is deprecated"); } BOOST_AUTO_TEST_CASE(leading_zero_rationals_convert) |