@@ -232,16 +232,16 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
232232
233233 /* Containers */
234234
235- internal final class KeyedContainer < T : Decodable , Key: CodingKey >
235+ internal final class KeyedContainer < D : Decodable , Key: CodingKey >
236236 : KeyedDecodingContainerProtocol
237237 {
238- let decoder : AdaptorRecordDecoder < T >
238+ let decoder : AdaptorRecordDecoder < D >
239239 let log : ZeeQLLogger
240240
241241 let codingPath : [ CodingKey ]
242242 let allKeys : [ Key ]
243243
244- init ( decoder: AdaptorRecordDecoder < T > ) {
244+ init ( decoder: AdaptorRecordDecoder < D > ) {
245245 self . decoder = decoder
246246 self . log = decoder. log
247247 self . codingPath = decoder. codingPath
@@ -275,8 +275,8 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
275275 * - base types column arrays, like `[Int]`,
276276 * - arrays of CodableObjectType`s aka relationships
277277 */
278- func decode< T > ( _ type: T . Type , forKey key: Key ) throws -> T
279- where T : Decodable
278+ func decode< X > ( _ type: X . Type , forKey key: Key ) throws -> X
279+ where X : Decodable
280280 {
281281 switch type {
282282 case is RelationshipHolderType . Type :
@@ -331,9 +331,9 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
331331 }
332332
333333 private
334- func decodeImplicitRelationshipHolder< T > ( _ type: T . Type , forKey key: Key )
335- throws -> T
336- where T : Decodable
334+ func decodeImplicitRelationshipHolder< X > ( _ type: X . Type , forKey key: Key )
335+ throws -> X
336+ where X : Decodable
337337 {
338338 // Right now this is an Array, eg `var addresses : [ Address ]`.
339339 // We just want to return an empty array here.
@@ -346,8 +346,8 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
346346 return v
347347 }
348348
349- func decodeOtherType< T > ( _ type: T . Type , forKey key: Key ) throws -> T
350- where T : Decodable
349+ func decodeOtherType< X > ( _ type: X . Type , forKey key: Key ) throws -> X
350+ where X : Decodable
351351 {
352352 log. trace ( " out of band type: " , type, " for key: " , key)
353353
@@ -358,10 +358,10 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
358358 /**
359359 * Decode base type column arrays, like `[ Int ]`
360360 */
361- func decodeBaseTypeArray< T , E> ( _ type: T . Type ,
361+ func decodeBaseTypeArray< X , E> ( _ type: X . Type ,
362362 _ elementType: E . Type ,
363- forKey key: Key ) throws -> T
364- where T : Decodable
363+ forKey key: Key ) throws -> X
364+ where X : Decodable
365365 {
366366 log. error ( " TODO: Array<Int> " )
367367 throw Error . unsupportedValueType ( type)
@@ -376,9 +376,9 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
376376 * while the other was reflected on.
377377 */
378378 private
379- func decodeRelationshipHolder< T > ( erasedHolderType : T . Type ,
380- forKey key : Key ) throws -> T
381- where T : Decodable
379+ func decodeRelationshipHolder< X > ( erasedHolderType : X . Type ,
380+ forKey key : Key ) throws -> X
381+ where X : Decodable
382382 {
383383 guard let reflectedHolderType =
384384 erasedHolderType as? RelationshipHolderType . Type
@@ -402,9 +402,9 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
402402 *
403403 * This is not actually supported in the AdaptorDecoder.
404404 */
405- private func decodeDecodableObject< T > ( _ type: T . Type ,
406- forKey key: Key ) throws -> T
407- where T : Decodable
405+ private func decodeDecodableObject< X > ( _ type: X . Type ,
406+ forKey key: Key ) throws -> X
407+ where X : Decodable
408408 {
409409 log. trace ( " :decode: " , key. stringValue, type)
410410 throw Error . unsupportedValueType ( type) // FIXME: proper error
@@ -445,14 +445,14 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
445445 log. trace ( " decoded-value for key: " , key, anyValue)
446446 return anyValue
447447 }
448- func decodeBaseType< T > ( forKey key: Key ) throws -> T {
448+ func decodeBaseType< X > ( forKey key: Key ) throws -> X {
449449 let anyValue = try valueForKey ( key)
450- guard let v = anyValue as? T else {
450+ guard let v = anyValue as? X else {
451451 log. error ( " unexpected base value: " , key,
452452 " \n value: " , anyValue,
453453 " \n types: " ,
454- type ( of: anyValue) , " vs " , T . self, " \n " )
455- throw Error . unsupportedValueType ( T . self)
454+ type ( of: anyValue) , " vs " , X . self, " \n " )
455+ throw Error . unsupportedValueType ( X . self)
456456 }
457457 log. trace ( " decoded-key: " , key, v)
458458 return v
@@ -542,11 +542,11 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
542542 * var addresses : [ Address ]
543543 *
544544 */
545- internal struct UnkeyedContainer < T : Decodable > : UnkeyedDecodingContainer {
545+ internal struct UnkeyedContainer < D : Decodable > : UnkeyedDecodingContainer {
546546 // TBD: is this also for `[ Int ]` and such? (I think we want to capture
547547 // those earlier as `[Int]`, `[Float]` etc).
548548 let log : ZeeQLLogger
549- let decoder : AdaptorRecordDecoder < T >
549+ let decoder : AdaptorRecordDecoder < D >
550550
551551 let sourceKey : CodingKey
552552
@@ -556,7 +556,7 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
556556
557557 var count : Int ? { return 0 } // no need to decode anything!
558558
559- init ( decoder : AdaptorRecordDecoder < T > , key : CodingKey ) {
559+ init ( decoder : AdaptorRecordDecoder < D > , key : CodingKey ) {
560560 self . decoder = decoder
561561 self . log = decoder. log
562562 self . sourceKey = key
@@ -571,7 +571,7 @@ public class AdaptorRecordDecoder<T: Decodable> : Decoder {
571571 *
572572 * We create our ToMany relationship in here.
573573 */
574- mutating func decode< T > ( _ type: T . Type ) throws -> T where T : Decodable {
574+ mutating func decode< X > ( _ type: X . Type ) throws -> X where X : Decodable {
575575 log. trace ( " decode index: " , currentIndex, type, " source-key: " , sourceKey)
576576 throw Error . adaptorCannotDecodeRelationships
577577 }
0 commit comments