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
17
17
@Suite ( " Never Tests " )
18
18
struct NeverTests {
19
19
@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
+
20
42
#expect( throws: DecodingError . self, performing: {
21
43
try JSONDecoder ( ) . decode ( Never . self, from: Data ( " null " . utf8) )
22
44
} )
You can’t perform that action at this time.
0 commit comments