aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/tupleAssignments
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-07-10 18:14:20 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-07-10 18:17:01 +0800
commitafa5f528f5912e59abc75fea13c62fb627fc9399 (patch)
treeace926e303d6f281717bfa61b729ad7063e3f1fc /test/libsolidity/syntaxTests/tupleAssignments
parent36022493dfae9135419fa8daacb4bb958fe753ef (diff)
downloaddexon-solidity-afa5f528f5912e59abc75fea13c62fb627fc9399.tar
dexon-solidity-afa5f528f5912e59abc75fea13c62fb627fc9399.tar.gz
dexon-solidity-afa5f528f5912e59abc75fea13c62fb627fc9399.tar.bz2
dexon-solidity-afa5f528f5912e59abc75fea13c62fb627fc9399.tar.lz
dexon-solidity-afa5f528f5912e59abc75fea13c62fb627fc9399.tar.xz
dexon-solidity-afa5f528f5912e59abc75fea13c62fb627fc9399.tar.zst
dexon-solidity-afa5f528f5912e59abc75fea13c62fb627fc9399.zip
Update tests.
Diffstat (limited to 'test/libsolidity/syntaxTests/tupleAssignments')
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/err_fill_assignment.sol11
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/err_multiple_storage_storage_copies_fill_left.sol (renamed from test/libsolidity/syntaxTests/tupleAssignments/warn_multiple_storage_storage_copies_fill_left.sol)2
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/err_multiple_storage_storage_copies_fill_right.sol (renamed from test/libsolidity/syntaxTests/tupleAssignments/warn_multiple_storage_storage_copies_fill_right.sol)2
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/error_fill.sol4
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/nowarn_explicit_singleton_token_expression.sol8
-rw-r--r--test/libsolidity/syntaxTests/tupleAssignments/warn_fill_assignment.sol11
6 files changed, 15 insertions, 23 deletions
diff --git a/test/libsolidity/syntaxTests/tupleAssignments/err_fill_assignment.sol b/test/libsolidity/syntaxTests/tupleAssignments/err_fill_assignment.sol
new file mode 100644
index 00000000..32b381bb
--- /dev/null
+++ b/test/libsolidity/syntaxTests/tupleAssignments/err_fill_assignment.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() public pure returns (uint, uint, bytes32) {
+ uint a;
+ bytes32 b;
+ (a,) = f();
+ (,b) = f();
+ }
+}
+// ----
+// TypeError: (103-106): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(uint256,).
+// TypeError: (117-120): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(,bytes32).
diff --git a/test/libsolidity/syntaxTests/tupleAssignments/warn_multiple_storage_storage_copies_fill_left.sol b/test/libsolidity/syntaxTests/tupleAssignments/err_multiple_storage_storage_copies_fill_left.sol
index b2979804..902d8b98 100644
--- a/test/libsolidity/syntaxTests/tupleAssignments/warn_multiple_storage_storage_copies_fill_left.sol
+++ b/test/libsolidity/syntaxTests/tupleAssignments/err_multiple_storage_storage_copies_fill_left.sol
@@ -6,5 +6,5 @@ contract C {
}
}
// ----
+// TypeError: (89-101): Type tuple(int_const 1,int_const 2,struct C.S storage ref,struct C.S storage ref) is not implicitly convertible to expected type tuple(,struct C.S storage ref,struct C.S storage ref).
// Warning: (79-101): This assignment performs two copies to storage. Since storage copies do not first copy to a temporary location, one of them might be overwritten before the second is executed and thus may have unexpected effects. It is safer to perform the copies separately or assign to storage pointers first.
-// Warning: (79-101): Different number of components on the left hand side (3) than on the right hand side (4).
diff --git a/test/libsolidity/syntaxTests/tupleAssignments/warn_multiple_storage_storage_copies_fill_right.sol b/test/libsolidity/syntaxTests/tupleAssignments/err_multiple_storage_storage_copies_fill_right.sol
index aa35d7d4..51556aab 100644
--- a/test/libsolidity/syntaxTests/tupleAssignments/warn_multiple_storage_storage_copies_fill_right.sol
+++ b/test/libsolidity/syntaxTests/tupleAssignments/err_multiple_storage_storage_copies_fill_right.sol
@@ -6,5 +6,5 @@ contract C {
}
}
// ----
+// TypeError: (90-102): Type tuple(struct C.S storage ref,struct C.S storage ref,int_const 1,int_const 2) is not implicitly convertible to expected type tuple(struct C.S storage ref,struct C.S storage ref,).
// Warning: (79-102): This assignment performs two copies to storage. Since storage copies do not first copy to a temporary location, one of them might be overwritten before the second is executed and thus may have unexpected effects. It is safer to perform the copies separately or assign to storage pointers first.
-// Warning: (79-102): Different number of components on the left hand side (3) than on the right hand side (4).
diff --git a/test/libsolidity/syntaxTests/tupleAssignments/error_fill.sol b/test/libsolidity/syntaxTests/tupleAssignments/error_fill.sol
index 5b7f870b..ae722391 100644
--- a/test/libsolidity/syntaxTests/tupleAssignments/error_fill.sol
+++ b/test/libsolidity/syntaxTests/tupleAssignments/error_fill.sol
@@ -8,5 +8,5 @@ contract C {
}
}
// ----
-// TypeError: (126-136): Different number of components on the left hand side (2) than on the right hand side (3).
-// TypeError: (140-150): Different number of components on the left hand side (2) than on the right hand side (3).
+// TypeError: (133-136): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(uint256,).
+// TypeError: (147-150): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(,bytes32).
diff --git a/test/libsolidity/syntaxTests/tupleAssignments/nowarn_explicit_singleton_token_expression.sol b/test/libsolidity/syntaxTests/tupleAssignments/nowarn_explicit_singleton_token_expression.sol
deleted file mode 100644
index 3262781b..00000000
--- a/test/libsolidity/syntaxTests/tupleAssignments/nowarn_explicit_singleton_token_expression.sol
+++ /dev/null
@@ -1,8 +0,0 @@
-contract C {
- function f() public pure {
- uint a;
- (a,) = (uint(1),);
- }
-}
-// ----
-// Warning: (53-70): Different number of components on the left hand side (2) than on the right hand side (1).
diff --git a/test/libsolidity/syntaxTests/tupleAssignments/warn_fill_assignment.sol b/test/libsolidity/syntaxTests/tupleAssignments/warn_fill_assignment.sol
deleted file mode 100644
index a079a509..00000000
--- a/test/libsolidity/syntaxTests/tupleAssignments/warn_fill_assignment.sol
+++ /dev/null
@@ -1,11 +0,0 @@
-contract C {
- function f() public pure returns (uint, uint, bytes32) {
- uint a;
- bytes32 b;
- (a,) = f();
- (,b) = f();
- }
-}
-// ----
-// Warning: (96-106): Different number of components on the left hand side (2) than on the right hand side (3).
-// Warning: (110-120): Different number of components on the left hand side (2) than on the right hand side (3).