From 7e3ef45d4658f0aee50d0a38dee119bf5427a3f0 Mon Sep 17 00:00:00 2001 From: Anton Pogonets Date: Mon, 2 Sep 2019 21:47:22 +0300 Subject: [PATCH] Restore using __SwiftValue in store on Linux --- Sources/Foundation/Bridging.swift | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Sources/Foundation/Bridging.swift b/Sources/Foundation/Bridging.swift index 3bc837c3ba..c46916cd56 100644 --- a/Sources/Foundation/Bridging.swift +++ b/Sources/Foundation/Bridging.swift @@ -187,17 +187,12 @@ internal final class __SwiftValue : NSObject, NSCopying { } else if let opt = value as? Unwrappable, opt.unwrap() == nil { return NSNull() } else { - #if canImport(ObjectiveC) - // On Darwin, this can be a native (ObjC) __SwiftValue. - let boxed = (value as AnyObject) - if !(boxed is NSObject) { - return __SwiftValue(value) // Do not emit native boxes — wrap them in Swift Foundation boxes instead. - } else { - return boxed as! NSObject - } - #else - return (value as AnyObject) as! NSObject - #endif + let boxed = (value as AnyObject) + if boxed is NSObject { + return boxed as! NSObject + } else { + return __SwiftValue(value) // Do not emit native boxes — wrap them in Swift Foundation boxes instead. + } } }