diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-16 05:30:09 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-09-04 19:31:10 +0800 |
commit | 82f512a7d40a3bd6a13dd799be66dd164fded077 (patch) | |
tree | fd9f01adf77c0abd676a13d1c2e1c60d8f20ce1a /test/libsolidity/syntaxTests/viewPureChecker | |
parent | f27d7edfd605ac04e04eafded93a9a4e81f20122 (diff) | |
download | dexon-solidity-82f512a7d40a3bd6a13dd799be66dd164fded077.tar dexon-solidity-82f512a7d40a3bd6a13dd799be66dd164fded077.tar.gz dexon-solidity-82f512a7d40a3bd6a13dd799be66dd164fded077.tar.bz2 dexon-solidity-82f512a7d40a3bd6a13dd799be66dd164fded077.tar.lz dexon-solidity-82f512a7d40a3bd6a13dd799be66dd164fded077.tar.xz dexon-solidity-82f512a7d40a3bd6a13dd799be66dd164fded077.tar.zst dexon-solidity-82f512a7d40a3bd6a13dd799be66dd164fded077.zip |
Add return data to bare calls.
Diffstat (limited to 'test/libsolidity/syntaxTests/viewPureChecker')
-rw-r--r-- | test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol | 6 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol index 2cb185c9..2503a319 100644 --- a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol +++ b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol @@ -3,8 +3,10 @@ contract C { address(this).transfer(1); require(address(this).send(2)); selfdestruct(address(this)); - require(address(this).delegatecall("")); - require(address(this).call("")); + (bool success,) = address(this).delegatecall(""); + require(success); + (success,) = address(this).call(""); + require(success); } function g() pure public { bytes32 x = keccak256("abc"); diff --git a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol index 9b00fd6d..f951feb4 100644 --- a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol +++ b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol @@ -9,15 +9,17 @@ contract C { selfdestruct(address(this)); } function i() view public { - require(address(this).delegatecall("")); + (bool success,) = address(this).delegatecall(""); + require(success); } function j() view public { - require(address(this).call("")); + (bool success,) = address(this).call(""); + require(success); } } // ---- // TypeError: (52-77): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. // TypeError: (132-153): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. // TypeError: (201-228): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. -// TypeError: (283-313): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. -// TypeError: (369-391): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. +// TypeError: (293-323): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. +// TypeError: (414-436): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable. |