aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-08-15 18:30:29 +0800
committerLeonardo Alt <leo@ethereum.org>2018-08-15 23:11:18 +0800
commitb6c839e817a35d51f44847558b8f1f4cf0ec1737 (patch)
tree36619b7e903dc51d40acb5a4ccdcaeec90fb7c5f /test/libsolidity
parent2ed793c4d345de909332651145265a21a04e92d1 (diff)
downloaddexon-solidity-b6c839e817a35d51f44847558b8f1f4cf0ec1737.tar.gz
dexon-solidity-b6c839e817a35d51f44847558b8f1f4cf0ec1737.tar.zst
dexon-solidity-b6c839e817a35d51f44847558b8f1f4cf0ec1737.zip
Disallow indexed reference types in events when using ABIEncoderV2
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/syntaxTests/events/event_array_indexed_v2.sol7
-rw-r--r--test/libsolidity/syntaxTests/events/event_array_v2.sol6
-rw-r--r--test/libsolidity/syntaxTests/events/event_nested_array_indexed_v2.sol7
-rw-r--r--test/libsolidity/syntaxTests/events/event_nested_array_v2.sol6
-rw-r--r--test/libsolidity/syntaxTests/events/event_struct_indexed_v2.sol8
-rw-r--r--test/libsolidity/syntaxTests/events/event_struct_v2.sol7
6 files changed, 41 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/events/event_array_indexed_v2.sol b/test/libsolidity/syntaxTests/events/event_array_indexed_v2.sol
new file mode 100644
index 00000000..6b126db4
--- /dev/null
+++ b/test/libsolidity/syntaxTests/events/event_array_indexed_v2.sol
@@ -0,0 +1,7 @@
+pragma experimental ABIEncoderV2;
+contract c {
+ event E(uint[] indexed);
+}
+// ----
+// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
+// TypeError: (59-65): Reference types cannot be indexed.
diff --git a/test/libsolidity/syntaxTests/events/event_array_v2.sol b/test/libsolidity/syntaxTests/events/event_array_v2.sol
new file mode 100644
index 00000000..9ccd9fc9
--- /dev/null
+++ b/test/libsolidity/syntaxTests/events/event_array_v2.sol
@@ -0,0 +1,6 @@
+pragma experimental ABIEncoderV2;
+contract c {
+ event E(uint[]);
+}
+// ----
+// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/events/event_nested_array_indexed_v2.sol b/test/libsolidity/syntaxTests/events/event_nested_array_indexed_v2.sol
new file mode 100644
index 00000000..5c556125
--- /dev/null
+++ b/test/libsolidity/syntaxTests/events/event_nested_array_indexed_v2.sol
@@ -0,0 +1,7 @@
+pragma experimental ABIEncoderV2;
+contract c {
+ event E(uint[][] indexed);
+}
+// ----
+// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
+// TypeError: (59-67): Reference types cannot be indexed.
diff --git a/test/libsolidity/syntaxTests/events/event_nested_array_v2.sol b/test/libsolidity/syntaxTests/events/event_nested_array_v2.sol
new file mode 100644
index 00000000..efc7439e
--- /dev/null
+++ b/test/libsolidity/syntaxTests/events/event_nested_array_v2.sol
@@ -0,0 +1,6 @@
+pragma experimental ABIEncoderV2;
+contract c {
+ event E(uint[][]);
+}
+// ----
+// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/events/event_struct_indexed_v2.sol b/test/libsolidity/syntaxTests/events/event_struct_indexed_v2.sol
new file mode 100644
index 00000000..8d2d4f8c
--- /dev/null
+++ b/test/libsolidity/syntaxTests/events/event_struct_indexed_v2.sol
@@ -0,0 +1,8 @@
+pragma experimental ABIEncoderV2;
+contract c {
+ struct S { uint a ; }
+ event E(S indexed);
+}
+// ----
+// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
+// TypeError: (85-86): Reference types cannot be indexed.
diff --git a/test/libsolidity/syntaxTests/events/event_struct_v2.sol b/test/libsolidity/syntaxTests/events/event_struct_v2.sol
new file mode 100644
index 00000000..97ca61b6
--- /dev/null
+++ b/test/libsolidity/syntaxTests/events/event_struct_v2.sol
@@ -0,0 +1,7 @@
+pragma experimental ABIEncoderV2;
+contract c {
+ struct S { uint a ; }
+ event E(S);
+}
+// ----
+// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.