We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6220382 commit 43df2adCopy full SHA for 43df2ad
Sources/ComposableArchitecture/SwiftUI/IdentifiedArray.swift
@@ -121,6 +121,17 @@ where ID: Hashable {
121
"""
122
)
123
}
124
+ if newValue![keyPath: self.id] != id {
125
+ fatalError(
126
+ """
127
+ Can't update element at identifier \(id) with element having mismatched identifier \
128
+ \(newValue![keyPath: self.id]).
129
+
130
+ If you would like to replace the element with identifier \(id) with an element with a \
131
+ new identifier, remove the existing element and then insert the new element, instead.
132
133
+ )
134
+ }
135
self.dictionary[id] = newValue
136
137
0 commit comments