diff options
author | Rhett Aultman <roadriverrail@gmail.com> | 2017-04-29 04:28:03 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-05-03 17:26:21 +0800 |
commit | a6faa5acf324a127aad11b354e48d7bb2bcf0fbc (patch) | |
tree | 1ec5c56660c185e945ed2f8c1999fc1c6e172623 /test | |
parent | a40c8cfb68f75c22c0082714d99e9c3a24a31051 (diff) | |
download | dexon-solidity-a6faa5acf324a127aad11b354e48d7bb2bcf0fbc.tar.gz dexon-solidity-a6faa5acf324a127aad11b354e48d7bb2bcf0fbc.tar.zst dexon-solidity-a6faa5acf324a127aad11b354e48d7bb2bcf0fbc.zip |
Treat returns with expressions as return param use
There are many cases of code where the return parameters exist mostly
as a form of documentation. This change ensures that they do not have
to be used in the function body so long as there is a return supplying
values
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 4695317a..ee4857aa 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -5663,6 +5663,22 @@ BOOST_AUTO_TEST_CASE(warn_unused_return_param) } )"; success(text); + text = R"( + contract C { + function f() returns (uint a) { + a = 1; + } + } + )"; + success(text); + text = R"( + contract C { + function f() returns (uint a) { + return 1; + } + } + )"; + success(text); } BOOST_AUTO_TEST_CASE(no_unused_warnings) |