File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -469,8 +469,8 @@ internal struct JSONDecoder: Decoder {
469469 mutating func decodeSingularEnumField< E: Enum > ( value: inout E ? ) throws
470470 where E. RawValue == Int {
471471 if scanner. skipOptionalNull ( ) {
472- if E . self is _CustomJSONCodable . Type {
473- value = try ( E . self as! _CustomJSONCodable . Type ) . decodedFromJSONNull ( ) as? E
472+ if let customDecodable = E . self as? _CustomJSONCodable . Type {
473+ value = try customDecodable . decodedFromJSONNull ( ) as? E
474474 return
475475 }
476476 value = nil
@@ -482,8 +482,8 @@ internal struct JSONDecoder: Decoder {
482482 mutating func decodeSingularEnumField< E: Enum > ( value: inout E ) throws
483483 where E. RawValue == Int {
484484 if scanner. skipOptionalNull ( ) {
485- if E . self is _CustomJSONCodable . Type {
486- value = try ( E . self as! _CustomJSONCodable . Type ) . decodedFromJSONNull ( ) as! E
485+ if let customDecodable = E . self as? _CustomJSONCodable . Type {
486+ value = try customDecodable . decodedFromJSONNull ( ) as! E
487487 return
488488 }
489489 value = E ( )
You can’t perform that action at this time.
0 commit comments