@@ -74,7 +74,7 @@ extension DictionaryEncoder {
7474 storage. push ( container: dictionary)
7575 }
7676
77- func encodeNil( forKey key: Key ) throws { }
77+ func encodeNil( forKey key: Key ) throws { set ( NSNull ( ) , forKey : key . stringValue ) }
7878 func encode( _ value: Bool , forKey key: Key ) throws { set ( value, forKey: key. stringValue) }
7979 func encode( _ value: Int , forKey key: Key ) throws { set ( value, forKey: key. stringValue) }
8080 func encode( _ value: Int8 , forKey key: Key ) throws { set ( value, forKey: key. stringValue) }
@@ -143,7 +143,7 @@ extension DictionaryEncoder {
143143 storage. push ( container: array)
144144 }
145145
146- func encodeNil( ) throws { }
146+ func encodeNil( ) throws { push ( NSNull ( ) ) }
147147 func encode( _ value: Bool ) throws { }
148148 func encode( _ value: Int ) throws { push ( try encoder. box ( value) ) }
149149 func encode( _ value: Int8 ) throws { push ( try encoder. box ( value) ) }
@@ -200,7 +200,7 @@ extension DictionaryEncoder {
200200 storage. push ( container: array)
201201 }
202202
203- func encodeNil( ) throws { }
203+ func encodeNil( ) throws { storage . push ( container : NSNull ( ) ) }
204204 func encode( _ value: Bool ) throws { storage. push ( container: value) }
205205 func encode( _ value: Int ) throws { storage. push ( container: value) }
206206 func encode( _ value: Int8 ) throws { storage. push ( container: value) }
0 commit comments