File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -381,10 +381,10 @@ private extension KeyValueDecoder {
381381 case . date:
382382 return try getValue ( )
383383 case . millisecondsSince1970:
384- return try Date ( timeIntervalSince1970: TimeInterval ( decode ( Int . self) ) / 1000 )
384+ return try Date ( timeIntervalSince1970: TimeInterval ( decode ( Int64 . self) ) / 1000 )
385385
386386 case . secondsSince1970:
387- return try Date ( timeIntervalSince1970: TimeInterval ( decode ( Int . self) ) )
387+ return try Date ( timeIntervalSince1970: TimeInterval ( decode ( Int64 . self) ) )
388388
389389 case . custom( let transform) :
390390 do {
Original file line number Diff line number Diff line change @@ -755,9 +755,9 @@ extension KeyValueEncoder.EncodedValue {
755755 case . custom( let transform) :
756756 return try . value( transform ( date) )
757757 case . millisecondsSince1970:
758- return . value( Int ( date. timeIntervalSince1970 * 1000 ) )
758+ return . value( Int64 ( date. timeIntervalSince1970 * 1000 ) )
759759 case . secondsSince1970:
760- return . value( Int ( date. timeIntervalSince1970) )
760+ return . value( Int64 ( date. timeIntervalSince1970) )
761761 }
762762 }
763763}
Original file line number Diff line number Diff line change @@ -425,7 +425,7 @@ struct KeyValueDecoderTests {
425425
426426 decoder. dateDecodingStrategy = . millisecondsSince1970
427427 #expect(
428- try decoder. decode ( Date . self, from: 978307200000 ) == referenceDate
428+ try decoder. decode ( Date . self, from: Int64 ( 978307200000 ) ) == referenceDate
429429 )
430430
431431 decoder. dateDecodingStrategy = . secondsSince1970
Original file line number Diff line number Diff line change @@ -687,12 +687,12 @@ struct KeyValueEncodedTests {
687687
688688 encoder. dateEncodingStrategy = . millisecondsSince1970
689689 #expect(
690- try encoder. encode ( referenceDate) as? Int == 978307200000
690+ try encoder. encode ( referenceDate) as? Int64 == 978307200000
691691 )
692692
693693 encoder. dateEncodingStrategy = . secondsSince1970
694694 #expect(
695- try encoder. encode ( referenceDate) as? Int == 978307200
695+ try encoder. encode ( referenceDate) as? Int64 == 978307200
696696 )
697697
698698#if compiler(>=6.1)
You can’t perform that action at this time.
0 commit comments