@@ -222,26 +222,6 @@ extension __ExpectationContext {
222222// MARK: - Collection comparison and diffing
223223
224224extension __ExpectationContext {
225- /// Convert an instance of `CollectionDifference` to one that is type-erased
226- /// over elements of type `Any`.
227- ///
228- /// - Parameters:
229- /// - difference: The difference to convert.
230- ///
231- /// - Returns: A type-erased copy of `difference`.
232- private static func _typeEraseCollectionDifference( _ difference: CollectionDifference < some Any > ) -> CollectionDifference < Any > {
233- CollectionDifference < Any > (
234- difference. lazy. map { change in
235- switch change {
236- case let . insert( offset, element, associatedWith) :
237- return . insert( offset: offset, element: element as Any , associatedWith: associatedWith)
238- case let . remove( offset, element, associatedWith) :
239- return . remove( offset: offset, element: element as Any , associatedWith: associatedWith)
240- }
241- }
242- ) !
243- }
244-
245225 /// Generate a description of a previously-computed collection difference.
246226 ///
247227 /// - Parameters:
@@ -317,7 +297,7 @@ extension __ExpectationContext {
317297
318298 if !result {
319299 differences [ opID] = { [ lhs, rhs] in
320- Self . _typeEraseCollectionDifference ( lhs. difference ( from: rhs) )
300+ CollectionDifference < Any > ( lhs. difference ( from: rhs) )
321301 }
322302 }
323303
@@ -380,7 +360,7 @@ extension __ExpectationContext {
380360 return nil
381361 }
382362
383- return Self . _typeEraseCollectionDifference ( diff)
363+ return CollectionDifference < Any > ( diff)
384364 }
385365 }
386366
0 commit comments