You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a dictionary literal has duplicate entries (example: let map = [1: "one", 1: "also one"]), the compile issues a warning "Dictionary literal of type '...' has duplicate entries for integer literal key '...'". But in this case the code at this point would crash, so a warning might not be enough. E.g. a CI pipeline might ignore warnings.
Proposed solution
"Dictionary literal of type '...' has duplicate entries for integer literal key '...'" should be an error and not a warning.
Alternatives considered
The only alternative is to leave it as a warning.
Additional information
Note that for duplicate entries of a dictionary, there also is the issue #77318Missing warning "has duplicate entries for integer literal key" when literal keys are produced by a macro.
The text was updated successfully, but these errors were encountered:
Motivation
When a dictionary literal has duplicate entries (example:
let map = [1: "one", 1: "also one"]
), the compile issues a warning "Dictionary literal of type '...' has duplicate entries for integer literal key '...'". But in this case the code at this point would crash, so a warning might not be enough. E.g. a CI pipeline might ignore warnings.Proposed solution
"Dictionary literal of type '...' has duplicate entries for integer literal key '...'" should be an error and not a warning.
Alternatives considered
The only alternative is to leave it as a warning.
Additional information
Note that for duplicate entries of a dictionary, there also is the issue #77318 Missing warning "has duplicate entries for integer literal key" when literal keys are produced by a macro.
The text was updated successfully, but these errors were encountered: