简体   繁体   English

升级到 Xcode 13.3、SwiftNIO、Vapor 后出现 CircularBuffer 错误

[英]CircularBuffer error after upgrading to Xcode 13.3, SwiftNIO, Vapor in the mix

I have a project that will not compile, after upgrading to Xcode 13.3 The error is我有一个无法编译的项目,升级到 Xcode 13.3 后错误是

Type 'CircularBuffer<Element>' does not conform to protocol 'MutableCollection'

and

Unavailable subscript 'subscript(_:)' was used to satisfy a requirement of protocol 'MutableCollection'

This is in the public struct MarkedCircularBuffer<Element>: CustomStringConvertible that is part of SwiftNIO.这是在public struct MarkedCircularBuffer<Element>: CustomStringConvertible中,它是 SwiftNIO 的一部分。

This pops up as soon as I try to build the project, which built and ran fine prior to the upgrade to Xcode 13.3.这会在我尝试构建项目时弹出,该项目在升级到 Xcode 13.3 之前构建并运行良好。

I don't have a starting point to figure this out.我没有一个起点来解决这个问题。 What should I be looking for?我应该寻找什么? My only intuition is that a number of async queries in my code dump the result into a _ rather than a variable, but that seems reasonable given the compiler suggests it…我唯一的直觉是,我的代码中的许多异步查询将结果转储到 _ 而不是变量中,但考虑到编译器的建议,这似乎是合理的……

EDIT: because there is a reference to protocols, I checked my code, and only one protocol is defined (but never implemented):编辑:因为有对协议的引用,所以我检查了我的代码,并且只定义了一个协议(但从未实现):

protocol storesSockets {
//    var sockets: Dictionary<String, Dictionary<String, WebSocket>>
    func addSocket(ws: WebSocket, pId: String, gameId: String, overwrite: Bool)
}

Commenting this code out does not change anything.注释掉这段代码不会改变任何东西。

UPDATE: I tried updating the packages in Swift... this caused a crash, which restarting Swift didn't fix, but restarting the machine did.更新:我尝试在 Swift 中更新软件包...这导致了崩溃,重新启动 Swift 并没有解决,但重新启动机器可以解决。 Or seems to have.或者似乎有。 So my problem has gone away...所以我的问题已经消失了......

I ran into the same problem and updated swift-nio to 2.40.0 to solve the problem.我遇到了同样的问题并将swift-nio更新到2.40.0以解决问题。

EDIT: Updating caused a crash sometimes (this might be related to the Apple Silicon M1 Mac) but after the crash and the finished update the error was gone.编辑:更新有时会导致崩溃(这可能与 Apple Silicon M1 Mac 有关)但在崩溃和完成更新后错误消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM