I just migrated a Swift 3.1 project from Xcode 8.3.3 to Swift 4 / Xcode 9 GM. I managed to resolve most compiler warnings, but this one sticks and I cannot find any info related to this. The code compiled without warning in Xcode 8.3.3. I am using snippets to illustrate the issue.
The warning exact warning is
FirebaseArrayDelegate.swift:22:26:
Redundant conformance constraint 'T': 'FirebaseModel'
and relates to the declaration of func initialized
(third line).
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)
}
FirebaseModel is defined as
public protocol FirebaseModel: AnyObject, Equatable {
init?(snapshot: DataSnapshot)
var key: String { get }
var ref: DatabaseReference { get }
}
and FirebaseArray as
open class FirebaseArray<T : FirebaseModel>: NSObject, Collection
Any idea what could cause this warning or might this be a bug in Xcode 9 GM? Thanks!
This is a bug in Swift, hopefully it will be addressed soon.
See: https://bugs.swift.org/browse/SR-6265
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With