aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorErik Kundt <bitshift@posteo.org>2018-04-23 22:20:37 +0800
committerErik Kundt <bitshift@posteo.org>2018-04-23 23:09:42 +0800
commitb2ff9bc88d50e89419317d54b00e80b4c18a92c7 (patch)
tree117693a6a9f8cf82ef0618007bdd7b6e65ebd8f1 /test
parentf2b58de92cdffe9d6e70aff2f0198277a5da335a (diff)
downloaddexon-solidity-b2ff9bc88d50e89419317d54b00e80b4c18a92c7.tar.gz
dexon-solidity-b2ff9bc88d50e89419317d54b00e80b4c18a92c7.tar.zst
dexon-solidity-b2ff9bc88d50e89419317d54b00e80b4c18a92c7.zip
Turns it into warning (error for 0.5.0) and adds Changelog entry.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_event.sol2
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol2
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_function.sol7
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol11
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_function_self.sol8
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol6
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol11
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol13
8 files changed, 45 insertions, 15 deletions
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_event.sol b/test/libsolidity/syntaxTests/types/empty_tuple_event.sol
index 10b9f345..3e40b155 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_event.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_event.sol
@@ -7,4 +7,4 @@ contract C {
}
// ----
// Warning: (95-106): Invoking events without "emit" prefix is deprecated.
-// TypeError: (95-106): Type of tuple component cannot be null.
+// Warning: (95-106): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol b/test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol
index 072234cb..aec5ff2a 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_event_050.sol
@@ -7,4 +7,4 @@ contract C {
}
// ----
// TypeError: (101-112): Event invocations have to be prefixed by "emit".
-// TypeError: (101-112): Type of tuple component cannot be null.
+// TypeError: (101-112): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_function.sol b/test/libsolidity/syntaxTests/types/empty_tuple_function.sol
index 33a55b95..05b54442 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_function.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_function.sol
@@ -1,11 +1,12 @@
pragma solidity ^0.4.3;
contract C {
- function f() {}
- function a() public {
+ function f() private pure {}
+ function a() public pure {
bool x = true;
bool y = true;
(x) ? (f(), y = false) : (f(), y = false);
}
}
// ----
-// TypeError: (144-147): Type of tuple component cannot be null.
+// Warning: (162-165): Tuple component cannot be empty.
+// Warning: (181-184): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol b/test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol
new file mode 100644
index 00000000..c4b9e03f
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol
@@ -0,0 +1,11 @@
+pragma experimental "v0.5.0";
+contract C {
+ function f() private pure {}
+ function a() public pure {
+ bool x = true;
+ bool y = true;
+ (x) ? (f(), y = false) : (f(), y = false);
+ }
+}
+// ----
+// TypeError: (168-171): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_function_self.sol b/test/libsolidity/syntaxTests/types/empty_tuple_function_self.sol
deleted file mode 100644
index 27ab1131..00000000
--- a/test/libsolidity/syntaxTests/types/empty_tuple_function_self.sol
+++ /dev/null
@@ -1,8 +0,0 @@
-pragma solidity ^0.4.3;
-contract C {
- function a() public {
- (a(), 7);
- }
-}
-// ----
-// TypeError: (72-75): Type of tuple component cannot be null.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol
index e7ae4b29..cba30c1b 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue.sol
@@ -1,6 +1,6 @@
pragma solidity ^0.4.3;
contract C {
- function f() public pure {}
+ function f() private pure {}
function a() public {
uint x;
uint y;
@@ -8,4 +8,6 @@ contract C {
}
}
// ----
-// TypeError: (145-148): Type of tuple component cannot be null.
+// Warning: (146-149): Tuple component cannot be empty.
+// Warning: (151-154): Tuple component cannot be empty.
+// TypeError: (145-155): Type tuple(tuple(),tuple()) is not implicitly convertible to expected type tuple(uint256,uint256).
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol
new file mode 100644
index 00000000..b0691778
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol
@@ -0,0 +1,11 @@
+pragma experimental "v0.5.0";
+contract C {
+ function f() private pure {}
+ function a() public {
+ uint x;
+ uint y;
+ (x, y) = (f(), f());
+ }
+}
+// ----
+// TypeError: (152-155): Tuple component cannot be empty.
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol
new file mode 100644
index 00000000..8d77df47
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol
@@ -0,0 +1,13 @@
+pragma solidity ^0.4.3;
+contract C {
+ function f() private pure {}
+ function a() public {
+ uint x;
+ uint y;
+ (x, y) = [f(), f()];
+ }
+}
+// ----
+// Warning: (146-149): Tuple component cannot be empty.
+// Warning: (151-154): Tuple component cannot be empty.
+// TypeError: (145-155): Type tuple()[2] memory is not implicitly convertible to expected type tuple(uint256,uint256).