[SR-3286] Dictionary element not removed in case of the value nil assignment #45874
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
not a bug
Resolution → not a bug: Reported as a bug but turned out to be expected behavior or programmer error
regression
standard library
Area: Standard library umbrella
swift 3.0
Environment
Additional Detail from JIRA
md5: 94f717bbadb9abaae2d591688134e5cf
is duplicated by:
Issue Description:
Description:
As documentation statements, subscript method of the Dictionary should remove element when nil value is assigned to the key.
Test case:
Expected result:
d.count result in the last line of code should be equal to 0
Actual result:
d.count result in the last line of code is equal to 1
Additional informations:
1: Without using type Any? for nil value, code works as expected
2: Using NSMutableDictionary instead of Dictionary works as expected
The text was updated successfully, but these errors were encountered: