-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow duplicate fields in address types (#1208)
* Disallow duplicate fields in address types * feat(test): Add test for duplicate field in address type * Rename testcase to make it clearer what it tests Co-authored-by: Georgiy Komarov <[email protected]>
- Loading branch information
Showing
4 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
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
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
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,15 @@ | ||
scilla_version 0 | ||
|
||
contract DuplicateField () | ||
|
||
procedure test | ||
( | ||
a : | ||
ByStr20 with contract | ||
field a : ByStr20 with end, | ||
field b : Map (ByStr20 with end) Bool, | ||
field b : Map (ByStr20 with end) Bool | ||
end | ||
) | ||
|
||
end |
14 changes: 14 additions & 0 deletions
14
tests/base/parser/bad/gold/address_duplicate_field.scilla.gold
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,14 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"error_message": "Syntax error: Duplicate field name b in address type", | ||
"start_location": { | ||
"file": "base/parser/bad/address_duplicate_field.scilla", | ||
"line": 8, | ||
"column": 7 | ||
}, | ||
"end_location": { "file": "", "line": 0, "column": 0 } | ||
} | ||
], | ||
"warnings": [] | ||
} |