@@ -145,11 +145,11 @@ private extension KeyValueEncoder {
145145
146146 final class Encoder : Swift . Encoder {
147147
148- let codingPath : [ CodingKey ]
148+ let codingPath : [ any CodingKey ]
149149 let userInfo : [ CodingUserInfoKey : Any ]
150150 let nilEncodingStrategy : NilEncodingStrategy
151151
152- init ( codingPath: [ CodingKey ] = [ ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
152+ init ( codingPath: [ any CodingKey ] = [ ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
153153 self . codingPath = codingPath
154154 self . userInfo = userInfo
155155 self . nilEncodingStrategy = nilEncodingStrategy
@@ -174,13 +174,13 @@ private extension KeyValueEncoder {
174174 return KeyedEncodingContainer ( keyed)
175175 }
176176
177- func unkeyedContainer( ) -> UnkeyedEncodingContainer {
177+ func unkeyedContainer( ) -> any UnkeyedEncodingContainer {
178178 let unkeyed = UnkeyedContainer ( codingPath: codingPath, userInfo: userInfo, nilEncodingStrategy: nilEncodingStrategy)
179179 container = . provider( unkeyed. getEncodedValue)
180180 return unkeyed
181181 }
182182
183- func singleValueContainer( ) -> SingleValueEncodingContainer {
183+ func singleValueContainer( ) -> any SingleValueEncodingContainer {
184184 let single = SingleContainer ( codingPath: codingPath, userInfo: userInfo, nilEncodingStrategy: nilEncodingStrategy)
185185 container = . provider( single. getEncodedValue)
186186 return single
@@ -201,11 +201,11 @@ private extension KeyValueEncoder {
201201 final class KeyedContainer < K: CodingKey > : KeyedEncodingContainerProtocol {
202202 typealias Key = K
203203
204- let codingPath : [ CodingKey ]
204+ let codingPath : [ any CodingKey ]
205205 private let userInfo : [ CodingUserInfoKey : Any ]
206206 private let nilEncodingStrategy : NilEncodingStrategy
207207
208- init ( codingPath: [ CodingKey ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
208+ init ( codingPath: [ any CodingKey ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
209209 self . codingPath = codingPath
210210 self . storage = [ : ]
211211 self . userInfo = userInfo
@@ -307,18 +307,18 @@ private extension KeyValueEncoder {
307307 return KeyedEncodingContainer ( keyed)
308308 }
309309
310- func nestedUnkeyedContainer( forKey key: K ) -> UnkeyedEncodingContainer {
310+ func nestedUnkeyedContainer( forKey key: K ) -> any UnkeyedEncodingContainer {
311311 let path = codingPath. appending ( key: key)
312312 let unkeyed = UnkeyedContainer ( codingPath: path, userInfo: userInfo, nilEncodingStrategy: nilEncodingStrategy)
313313 storage [ key. stringValue] = . provider( unkeyed. getEncodedValue)
314314 return unkeyed
315315 }
316316
317- func superEncoder( ) -> Swift . Encoder {
317+ func superEncoder( ) -> any Swift . Encoder {
318318 return superEncoder ( forKey: Key ( stringValue: " super " ) !)
319319 }
320320
321- func superEncoder( forKey key: Key ) -> Swift . Encoder {
321+ func superEncoder( forKey key: Key ) -> any Swift . Encoder {
322322 let path = codingPath. appending ( key: key)
323323 let encoder = Encoder ( codingPath: path, userInfo: userInfo, nilEncodingStrategy: nilEncodingStrategy)
324324 storage [ key. stringValue] = . provider( encoder. getEncodedValue)
@@ -328,11 +328,11 @@ private extension KeyValueEncoder {
328328
329329 final class UnkeyedContainer : Swift . UnkeyedEncodingContainer {
330330
331- let codingPath : [ CodingKey ]
331+ let codingPath : [ any CodingKey ]
332332 private let userInfo : [ CodingUserInfoKey : Any ]
333333 private let nilEncodingStrategy : NilEncodingStrategy
334334
335- init ( codingPath: [ CodingKey ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
335+ init ( codingPath: [ any CodingKey ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
336336 self . codingPath = codingPath
337337 self . userInfo = userInfo
338338 self . nilEncodingStrategy = nilEncodingStrategy
@@ -437,14 +437,14 @@ private extension KeyValueEncoder {
437437 return KeyedEncodingContainer ( keyed)
438438 }
439439
440- func nestedUnkeyedContainer( ) -> UnkeyedEncodingContainer {
440+ func nestedUnkeyedContainer( ) -> any UnkeyedEncodingContainer {
441441 let path = codingPath. appending ( index: count)
442442 let unkeyed = UnkeyedContainer ( codingPath: path, userInfo: userInfo, nilEncodingStrategy: nilEncodingStrategy)
443443 storage. append ( . provider( unkeyed. getEncodedValue) )
444444 return unkeyed
445445 }
446446
447- func superEncoder( ) -> Swift . Encoder {
447+ func superEncoder( ) -> any Swift . Encoder {
448448 let path = codingPath. appending ( index: count)
449449 let encoder = Encoder ( codingPath: path, userInfo: userInfo, nilEncodingStrategy: nilEncodingStrategy)
450450 storage. append ( . provider( encoder. getEncodedValue) )
@@ -454,11 +454,11 @@ private extension KeyValueEncoder {
454454
455455 final class SingleContainer : SingleValueEncodingContainer {
456456
457- let codingPath : [ CodingKey ]
457+ let codingPath : [ any CodingKey ]
458458 private let userInfo : [ CodingUserInfoKey : Any ]
459459 private let nilEncodingStrategy : NilEncodingStrategy
460460
461- init ( codingPath: [ CodingKey ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
461+ init ( codingPath: [ any CodingKey ] , userInfo: [ CodingUserInfoKey : Any ] , nilEncodingStrategy: NilEncodingStrategy ) {
462462 self . codingPath = codingPath
463463 self . userInfo = userInfo
464464 self . nilEncodingStrategy = nilEncodingStrategy
@@ -547,21 +547,21 @@ private extension KeyValueEncoder {
547547 }
548548}
549549
550- extension Array where Element == CodingKey {
550+ extension Array where Element == any CodingKey {
551551
552- func appending( key codingKey: CodingKey ) -> [ CodingKey ] {
552+ func appending( key codingKey: any CodingKey ) -> [ any CodingKey ] {
553553 var path = self
554554 path. append ( codingKey)
555555 return path
556556 }
557557
558- func appending( index: Int ) -> [ CodingKey ] {
558+ func appending( index: Int ) -> [ any CodingKey ] {
559559 var path = self
560560 path. append ( AnyCodingKey ( intValue: index) )
561561 return path
562562 }
563563
564- func makeKeyPath( appending key: CodingKey ? = nil ) -> String {
564+ func makeKeyPath( appending key: ( any CodingKey ) ? = nil ) -> String {
565565 var path = map ( \. keyPath)
566566 if let key = key {
567567 path. append ( key. keyPath)
0 commit comments