-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests for 3 level nested mapping
- Loading branch information
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
test/libsolidity/syntaxTests/parsing/mapping_with_names_func_param_7.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
contract test { | ||
function _main(mapping(uint name1 => mapping(uint name2 => mapping(uint name3 => uint name4) name5) name6) storage map) internal { | ||
map[1][2][3] = 4; | ||
} | ||
} | ||
// ---- |
4 changes: 4 additions & 0 deletions
4
test/libsolidity/syntaxTests/parsing/mapping_with_names_func_type_param_7.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
contract test { | ||
function(mapping(uint name1 => mapping(uint name2 => mapping(uint name3 => uint name4) name5) name6) storage) internal stateVariableName; | ||
} | ||
// ---- |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/parsing/mapping_with_names_local_7.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract test { | ||
mapping(uint nameSame => mapping(uint name1 => mapping(uint nameSame => uint name3) name6) name4) map; | ||
|
||
function main() external { | ||
mapping(uint nameSame => mapping(uint name1 => mapping(uint nameSame => uint name3) name6) name4) storage _map = map; | ||
_map[1][2][3] = 4; | ||
} | ||
} | ||
// ---- | ||
// DeclarationError 1809: (20-117): Conflicting parameter name "nameSame" in mapping. | ||
// DeclarationError 1809: (163-260): Conflicting parameter name "nameSame" in mapping. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/parsing/mapping_with_names_local_8.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract test { | ||
mapping(uint name1 => mapping(uint name2 => mapping(uint name3 => uint name4) name5) name6) map; | ||
|
||
function main() external { | ||
mapping(uint name1 => mapping(uint name2 => mapping(uint name3 => uint name4) name5) name6) storage _map = map; | ||
_map[1][2][3] = 4; | ||
} | ||
} | ||
// ---- |
4 changes: 4 additions & 0 deletions
4
test/libsolidity/syntaxTests/parsing/mapping_with_names_nested_8.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
contract test { | ||
mapping(uint name1 => mapping(uint name2 => mapping(uint name3 => uint name4) name5) name6) public name7; | ||
} | ||
// ---- |
6 changes: 6 additions & 0 deletions
6
test/libsolidity/syntaxTests/parsing/mapping_with_names_struct_member_7.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
contract test { | ||
struct Person { | ||
mapping(uint name1 => mapping(uint name2 => mapping(uint name3 => uint name4) name5) name6) name7; | ||
} | ||
} | ||
// ---- |