mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
`withHiddenCopies(if:of:)` is supposed to check for value semantic violations where mutations of one copy affect another -- however, it currently only checks that iteration returns the same items before/after the change, not that the old copy is still in a fully consistent state. Add an extra parameter that can be set to a closure that performs stricter checks. Use it to call `_checkInvariants()` in ordered collections tests, uncovering a missing uniqueness check in `OrderedSet._insertNew(_:at:in:)`.