diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-07-25 03:10:03 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-07-25 18:01:41 +0800 |
commit | fa68e0019f92a2327bd31288e75ce44f3c8daf68 (patch) | |
tree | a06c28102707aeb95b23c63b2cb416b2052c3a9a | |
parent | 008eb1c2c9830f655bbfb91865d463828dbffe1d (diff) | |
download | dexon-solidity-fa68e0019f92a2327bd31288e75ce44f3c8daf68.tar.gz dexon-solidity-fa68e0019f92a2327bd31288e75ce44f3c8daf68.tar.zst dexon-solidity-fa68e0019f92a2327bd31288e75ce44f3c8daf68.zip |
Add syntax test for location specifier redeclarations
3 files changed, 23 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/parsing/location_specifiers_for_locals_multi.sol b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_locals_multi.sol new file mode 100644 index 00000000..d53208ef --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_locals_multi.sol @@ -0,0 +1,12 @@ +contract Foo { + uint[] m_x; + function f() public view { + uint[] storage memory x = m_x; + uint[] memory storage calldata y; + x; y; + } +} +// ---- +// ParserError: (85-91): Location already specified. +// ParserError: (123-130): Location already specified. +// ParserError: (131-139): Location already specified. diff --git a/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params_multi.sol b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params_multi.sol new file mode 100644 index 00000000..c6155c09 --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params_multi.sol @@ -0,0 +1,6 @@ +contract Foo { + function f(uint[] storage memory constant x, uint[] memory calldata y) internal { } +} +// ---- +// ParserError: (45-51): Location already specified. +// ParserError: (78-86): Location already specified. diff --git a/test/libsolidity/syntaxTests/parsing/location_specifiers_for_state_variables_multi.sol b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_state_variables_multi.sol new file mode 100644 index 00000000..e34df2b2 --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_state_variables_multi.sol @@ -0,0 +1,5 @@ +contract Foo { + uint[] memory storage calldata x; +} +// ---- +// ParserError: (23-29): Expected identifier but got 'memory' |