File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,28 @@ import Testing
1717@Suite ( " Never Tests " )
1818struct NeverTests {
1919 @Test func retroactiveCodableWorks( ) async throws {
20+ // struct CustomEncoder: Encoder {
21+ // var codingPath: [any CodingKey] = []
22+ // var userInfo: [CodingUserInfoKey : Any] = [:]
23+ //
24+ // func container<Key>(keyedBy type: Key.Type) -> KeyedEncodingContainer<Key> where Key : CodingKey {
25+ // fatalError()
26+ // }
27+ //
28+ // func unkeyedContainer() -> any UnkeyedEncodingContainer {
29+ // fatalError()
30+ // }
31+ //
32+ // func singleValueContainer() -> any SingleValueEncodingContainer {
33+ // fatalError()
34+ // }
35+ // }
36+ //
37+ // struct DummyNever: Encodable {}
38+ //
39+ // let encodeFunction = unsafeBitCast(Never.encode, to: type(of: DummyNever.encode))
40+ // try encodeFunction(DummyNever())(CustomEncoder())
41+
2042 #expect( throws: DecodingError . self, performing: {
2143 try JSONDecoder ( ) . decode ( Never . self, from: Data ( " null " . utf8) )
2244 } )
You can’t perform that action at this time.
0 commit comments