Hi,
I got a very weird crash when merging dictionaries, and I couldn't find anything anywhere.
I posted it in the apple forums, and was directed here to see if you guys could maybe find the issue: https://forums.developer.apple.com/message/351321
Have a method that is func getSubscriptions(for group: Group) -> [String: Bool].
And then this line crashes
func getSubscriptions(for groups: [Group]) -> [String: Bool] {
----> return groups.compactMap({ getSubscriptions(for: $0) }).reduce([:]) { $0.merging($1){ (current, _) in current } }
}
- I have validated that this all occurs only and always on main thread
Any ideas? Below is the stack trace:
Crashed: com.apple.main-thread
0 libswiftCore.dylib 0x102c7a1ac hidden#6617 (_hidden#17759:135)
1 libswiftCore.dylib 0x102ae1dd0 assertionFailure first-element-marker first-element-marker fileflags(:::::) (_hidden#17736)
2 MY_APP 0x100c5929c specialized VariantDictionaryBuffer.nativeMerge<A>(:uniquingKeysWith:) (<compiler-generated>)
3 MY_APP 0x100c5ae50 specialized Dictionary.init<A>(uniqueKeysWithValues:) (<compiler-generated>)
4 MY_APP 0x100c491e8 MyViewController.getSubscriptions(for:) (<compiler-generated>)