aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-05 05:47:56 +0800
committerGitHub <noreply@github.com>2018-09-05 05:47:56 +0800
commite6aa15bae1839ce6761c75521e0166c06469dc2e (patch)
tree76969e415aa662d6d885bf41b6f938a04a986add /test
parent85debe77d9b616a37ecf0ed080045b3747b3aa7d (diff)
parent624dbbe142fb04fdcdd83d843a00138eed296763 (diff)
downloaddexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar.gz
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.tar.zst
dexon-solidity-e6aa15bae1839ce6761c75521e0166c06469dc2e.zip
Merge pull request #4895 from ethereum/abidecodesingle
Fix abi.decode returning single value.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_empty.sol7
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_single_return.sol5
2 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_empty.sol b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_empty.sol
new file mode 100644
index 00000000..9972f01d
--- /dev/null
+++ b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_empty.sol
@@ -0,0 +1,7 @@
+contract C {
+ function f() public pure {
+ abi.decode("abc", ());
+ }
+}
+// ----
+// Warning: (52-73): Statement has no effect.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_single_return.sol b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_single_return.sol
new file mode 100644
index 00000000..654b7873
--- /dev/null
+++ b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_single_return.sol
@@ -0,0 +1,5 @@
+contract C {
+ function f() public pure returns (bool) {
+ return abi.decode("abc", (uint)) == 2;
+ }
+}