Revision history [back]
The debugger is probably changing how the program is executed. This can happen, particularly in threaded code. You may want to attach a Swift debugger to it and hopefully see what is inserting the duplicate key (I assume this is possible, but haven't worked with Swift so could be wrong). We'd probably need a reproducible test case in order to look into it ourselves.