Swift memory leak when iterating array of Errors
问题 I'm relatively new to Swift, so I hope I'm not asking a stupid question. I have some code that instantiates an array of type Error , which will later be iterated and printed to the console. When running this code through Instruments using the "Leaks" instrument, it shows a leak of _SwiftNativeNSError . If I change the array type from [Error] to [Any] , the leak disappears, even though it is still actually holding an object conforming to Error . The leak is not reproducible with any other data