aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/specialFunctions
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/syntaxTests/specialFunctions')
-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
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol16
3 files changed, 20 insertions, 8 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;
+ }
+}
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
index c97f588e..6e0b6db4 100644
--- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
@@ -1,13 +1,13 @@
contract C {
function f() public pure {
- bool a = address(this).call(abi.encode(address(this).delegatecall, super));
- bool b = address(this).delegatecall(abi.encode(log0, tx, mulmod));
- a; b;
+ (bool a,) = address(this).call(abi.encode(address(this).delegatecall, super));
+ (a,) = address(this).delegatecall(abi.encode(log0, tx, mulmod));
+ a;
}
}
// ----
-// TypeError: (91-117): This type cannot be encoded.
-// TypeError: (119-124): This type cannot be encoded.
-// TypeError: (183-187): This type cannot be encoded.
-// TypeError: (189-191): This type cannot be encoded.
-// TypeError: (193-199): This type cannot be encoded.
+// TypeError: (94-120): This type cannot be encoded.
+// TypeError: (122-127): This type cannot be encoded.
+// TypeError: (184-188): This type cannot be encoded.
+// TypeError: (190-192): This type cannot be encoded.
+// TypeError: (194-200): This type cannot be encoded.