forked from shadowfacts/Tusker
Better generics for LazilyDecoding
This commit is contained in:
parent
cc0da2ec54
commit
ecab33bdce
|
@ -58,8 +58,8 @@ public struct LazilyDecoding<Enclosing, Value: Codable> {
|
|||
}
|
||||
|
||||
extension LazilyDecoding {
|
||||
init(arrayFrom keyPath: ReferenceWritableKeyPath<Enclosing, Data?>) {
|
||||
self.init(from: keyPath, fallback: [] as! Value)
|
||||
init<T: Codable>(arrayFrom keyPath: ReferenceWritableKeyPath<Enclosing, Data?>) where Value == [T] {
|
||||
self.init(from: keyPath, fallback: [])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue