Swift 4中的冗余一致性约束警告

Geo*_*org 6 swift swift4

我刚刚将Swift 3.1项目从Xcode 8.3.3迁移到Swift 4/Xcode 9 GM.我设法解决了大多数编译器警告,但是这个警告,我找不到任何与此相关的信息.代码在Xcode 8.3.3中编译时没有警告.我正在使用代码片段来说明问题.

警告确切的警告是

FirebaseArrayDelegate.swift:22:26: 
    Redundant conformance constraint 'T': 'FirebaseModel'
Run Code Online (Sandbox Code Playgroud)

并涉及func initialized(第三行)的声明.

public protocol FirebaseArrayDelegate: class {

    func update(with block: (()->Void)?)
    func initialized<T : FirebaseModel>(array: FirebaseArray<T>)
    func added<T : FirebaseModel>(child: T, at index: Int)
    func changed<T : FirebaseModel>(child: T, at index: Int)
    func removed<T : FirebaseModel>(child: T, at index: Int)
    func moved<T : FirebaseModel>(child: T, from oldIndex: Int, to newIndex: Int)
    func changedSortOrder()
    func cancelled(with error: Error)

}
Run Code Online (Sandbox Code Playgroud)

FirebaseModel定义为

public protocol FirebaseModel: AnyObject, Equatable {

    init?(snapshot: DataSnapshot)
    var key: String { get }
    var ref: DatabaseReference { get }

}
Run Code Online (Sandbox Code Playgroud)

和FirebaseArray一样

open class FirebaseArray<T : FirebaseModel>: NSObject, Collection
Run Code Online (Sandbox Code Playgroud)

知道什么可能导致此警告或者这可能是Xcode 9 GM中的错误吗?谢谢!

Der*_*mot 4

这是 Swift 中的一个错误,希望很快就能得到解决。

请参阅: https: //bugs.swift.org/browse/SR-6265