Skip to content

Commit

Permalink
Forbid duplicate keys in dictionary literals
Browse files Browse the repository at this point in the history
RELNOTES:
    When using the dictionary literal syntax, it is now an error to have
    duplicated keys (e.g.  {'ab': 3, 'ab': 5}).
PiperOrigin-RevId: 167750614
  • Loading branch information
laurentlb authored and meteorcloudy committed Sep 7, 2017
1 parent c31f696 commit 35e0c2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion site/docs/skylark/backward-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ If you really want to override a value, use a separate statement:
`mydict["a"] = 4`.

* Flag: `--incompatible_dict_literal_has_no_duplicates`
* Default: `false`
* Default: `true`


## Checked arithmetic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable

@Option(
name = "incompatible_dict_literal_has_no_duplicates",
defaultValue = "false",
defaultValue = "true",
category = "incompatible changes",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
Expand Down

0 comments on commit 35e0c2d

Please sign in to comment.