aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/parsing
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-07-31 17:44:39 +0800
committerLeonardo Alt <leo@ethereum.org>2018-08-16 17:59:41 +0800
commit583e7156ba214c98096217d18f6270e4a46491d9 (patch)
treeaf71c85a7044eecb09bcdb329be5923b4bc9f105 /test/libsolidity/syntaxTests/parsing
parentcc6fa6d61fb934617d088bb04766ef0dea614b4f (diff)
downloaddexon-solidity-583e7156ba214c98096217d18f6270e4a46491d9.tar
dexon-solidity-583e7156ba214c98096217d18f6270e4a46491d9.tar.gz
dexon-solidity-583e7156ba214c98096217d18f6270e4a46491d9.tar.bz2
dexon-solidity-583e7156ba214c98096217d18f6270e4a46491d9.tar.lz
dexon-solidity-583e7156ba214c98096217d18f6270e4a46491d9.tar.xz
dexon-solidity-583e7156ba214c98096217d18f6270e4a46491d9.tar.zst
dexon-solidity-583e7156ba214c98096217d18f6270e4a46491d9.zip
Dynamic type as mapping key returns error instead of assertion fail
Diffstat (limited to 'test/libsolidity/syntaxTests/parsing')
-rw-r--r--test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_1.sol5
-rw-r--r--test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_2.sol8
-rw-r--r--test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_3.sol8
-rw-r--r--test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_4.sol5
4 files changed, 26 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_1.sol b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_1.sol
new file mode 100644
index 00000000..ea2d282c
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_1.sol
@@ -0,0 +1,5 @@
+contract c {
+ mapping(uint[] => uint) data;
+}
+// ----
+// ParserError: (26-27): Expected '=>' but got '['
diff --git a/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_2.sol b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_2.sol
new file mode 100644
index 00000000..713cddeb
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_2.sol
@@ -0,0 +1,8 @@
+contract c {
+ struct S {
+ uint x;
+ }
+ mapping(S => uint) data;
+}
+// ----
+// ParserError: (47-48): Expected elementary type name for mapping key type
diff --git a/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_3.sol b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_3.sol
new file mode 100644
index 00000000..655af9de
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_3.sol
@@ -0,0 +1,8 @@
+contract c {
+ struct S {
+ string s;
+ }
+ mapping(S => uint) data;
+}
+// ----
+// ParserError: (49-50): Expected elementary type name for mapping key type
diff --git a/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_4.sol b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_4.sol
new file mode 100644
index 00000000..f4dcb00a
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/mapping_nonelementary_key_4.sol
@@ -0,0 +1,5 @@
+contract c {
+ mapping(string[] => uint) data;
+}
+// ----
+// ParserError: (28-29): Expected '=>' but got '['