We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4cb7cb commit e05884bCopy full SHA for e05884b
Foundation/NSJSONSerialization.swift
@@ -273,11 +273,7 @@ private struct JSONWriter {
273
274
if let str = obj as? String {
275
try serializeString(str)
276
- } else if let num = obj as? Int {
277
- try serializeNumber(NSNumber(value: num))
278
- } else if let num = obj as? Double {
279
280
- } else if let num = obj as? NSNumber {
+ } else if let num = _SwiftValue.store(obj) as? NSNumber {
281
try serializeNumber(num)
282
} else if let array = obj as? Array<Any> {
283
try serializeArray(array)
0 commit comments