Skip to content

Commit cc3db35

Browse files
authored
Merge pull request #19497 from lorentey/dictionary-values-accessor
[stdlib] Dictionary.values: Replace setter with _modify
2 parents 6cef0be + 8372fb3 commit cc3db35

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/public/core/Dictionary.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,11 @@ extension Dictionary {
12891289
get {
12901290
return Values(_dictionary: self)
12911291
}
1292-
set {
1293-
self._variant = newValue._variant
1292+
_modify {
1293+
var values = Values(_dictionary: self)
1294+
_variant = .native(_NativeDictionary())
1295+
yield &values
1296+
self._variant = values._variant
12941297
}
12951298
}
12961299

0 commit comments

Comments
 (0)