diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-04-12 21:10:11 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-04-12 22:46:35 +0800 |
commit | db40bd46afe6c33af2f3b7e0d9a268e088592b2c (patch) | |
tree | b320870956c3ff96f46da77d34a5d93f850a6472 /test | |
parent | 6862f2294357d18a4640e95e3f9235692e6c055e (diff) | |
download | dexon-solidity-db40bd46afe6c33af2f3b7e0d9a268e088592b2c.tar.gz dexon-solidity-db40bd46afe6c33af2f3b7e0d9a268e088592b2c.tar.zst dexon-solidity-db40bd46afe6c33af2f3b7e0d9a268e088592b2c.zip |
Add additional test for ``var`` for storage variables.
Diffstat (limited to 'test')
3 files changed, 36 insertions, 7 deletions
diff --git a/test/libsolidity/syntaxTests/parsing/return_var.sol b/test/libsolidity/syntaxTests/parsing/return_var.sol index 113032a7..47ac9ef0 100644 --- a/test/libsolidity/syntaxTests/parsing/return_var.sol +++ b/test/libsolidity/syntaxTests/parsing/return_var.sol @@ -1,13 +1,25 @@ contract C { function f() returns(var) {} function f() returns(var x) {} + function f() returns(var x, uint y) {} + function f() returns(uint x, var y) {} + function f() returns(var x, var y) {} function f() public pure returns (var storage) {} function f() public pure returns (var storage x) {} + function f() public pure returns (var storage x, var storage y) {} } // ---- // 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. +// ParserError: (106-106): Expected explicit type name. +// ParserError: (157-157): Expected explicit type name. +// ParserError: (192-192): Expected explicit type name. +// ParserError: (199-199): Expected explicit type name. +// ParserError: (247-247): Expected explicit type name. +// ParserError: (251-251): Location specifier needs explicit type name. +// ParserError: (301-301): Expected explicit type name. +// ParserError: (305-305): Location specifier needs explicit type name. +// ParserError: (357-357): Expected explicit type name. +// ParserError: (361-361): Location specifier needs explicit type name. +// ParserError: (372-372): Expected explicit type name. +// ParserError: (376-376): 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 index cb166c7d..e041247d 100644 --- a/test/libsolidity/syntaxTests/parsing/var_in_function_arguments.sol +++ b/test/libsolidity/syntaxTests/parsing/var_in_function_arguments.sol @@ -1,13 +1,25 @@ contract C { function f(var) public pure {} function f(var x) public pure {} + function f(var x, var y) public pure {} + function f(uint x, var y) public pure {} + function f(var x, uint y) public pure {} function f(var storage) public pure {} function f(var storage x) public pure {} + function f(var storage x, var storage y) 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. +// ParserError: (107-107): Expected explicit type name. +// ParserError: (152-152): Expected explicit type name. +// ParserError: (189-189): Expected explicit type name. +// ParserError: (234-234): Expected explicit type name. +// ParserError: (238-238): Location specifier needs explicit type name. +// ParserError: (277-277): Expected explicit type name. +// ParserError: (281-281): Location specifier needs explicit type name. +// ParserError: (322-322): Expected explicit type name. +// ParserError: (326-326): Location specifier needs explicit type name. +// ParserError: (337-337): Expected explicit type name. +// ParserError: (341-341): Location specifier needs explicit type name. diff --git a/test/libsolidity/syntaxTests/parsing/var_storage_var.sol b/test/libsolidity/syntaxTests/parsing/var_storage_var.sol new file mode 100644 index 00000000..431d4ca5 --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/var_storage_var.sol @@ -0,0 +1,5 @@ +contract C { + var a; +} +// ---- +// ParserError: (17-17): Function, variable, struct or modifier declaration expected. |