aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-04-12 20:57:14 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-04-12 20:57:14 +0800
commit6862f2294357d18a4640e95e3f9235692e6c055e (patch)
tree8676110f4e82de0cebf5a91bf4547aa499184823 /test/libsolidity/syntaxTests
parentc3dc67d0e0c311a907e7a27e159f9159d78af949 (diff)
downloaddexon-solidity-6862f2294357d18a4640e95e3f9235692e6c055e.tar.gz
dexon-solidity-6862f2294357d18a4640e95e3f9235692e6c055e.tar.zst
dexon-solidity-6862f2294357d18a4640e95e3f9235692e6c055e.zip
Fix internal compiler error when parsing ``var`` declaration without identifier.
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r--test/libsolidity/syntaxTests/parsing/return_var.sol13
-rw-r--r--test/libsolidity/syntaxTests/parsing/var_in_function_arguments.sol13
2 files changed, 26 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/parsing/return_var.sol b/test/libsolidity/syntaxTests/parsing/return_var.sol
new file mode 100644
index 00000000..113032a7
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/return_var.sol
@@ -0,0 +1,13 @@
+contract C {
+ function f() returns(var) {}
+ function f() returns(var x) {}
+ function f() public pure returns (var storage) {}
+ function f() public pure returns (var storage x) {}
+}
+// ----
+// ParserError: (38-38): Expected explicit type name.
+// ParserError: (71-71): Expected explicit type name.
+// ParserError: (119-119): Expected explicit type name.
+// ParserError: (123-123): Location specifier needs explicit type name.
+// ParserError: (173-173): Expected explicit type name.
+// ParserError: (177-177): Location specifier needs explicit type name.
diff --git a/test/libsolidity/syntaxTests/parsing/var_in_function_arguments.sol b/test/libsolidity/syntaxTests/parsing/var_in_function_arguments.sol
new file mode 100644
index 00000000..cb166c7d
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/var_in_function_arguments.sol
@@ -0,0 +1,13 @@
+contract C {
+ function f(var) public pure {}
+ function f(var x) public pure {}
+ function f(var storage) public pure {}
+ function f(var storage x) public pure {}
+}
+// ----
+// ParserError: (28-28): Expected explicit type name.
+// ParserError: (63-63): Expected explicit type name.
+// ParserError: (100-100): Expected explicit type name.
+// ParserError: (104-104): Location specifier needs explicit type name.
+// ParserError: (143-143): Expected explicit type name.
+// ParserError: (147-147): Location specifier needs explicit type name.