Skip to content

Commit 7e3ef45

Browse files
zayassmillenomi
authored andcommitted
Restore using __SwiftValue in store on Linux
1 parent 807e415 commit 7e3ef45

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

Sources/Foundation/Bridging.swift

+6-11
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,12 @@ internal final class __SwiftValue : NSObject, NSCopying {
187187
} else if let opt = value as? Unwrappable, opt.unwrap() == nil {
188188
return NSNull()
189189
} else {
190-
#if canImport(ObjectiveC)
191-
// On Darwin, this can be a native (ObjC) __SwiftValue.
192-
let boxed = (value as AnyObject)
193-
if !(boxed is NSObject) {
194-
return __SwiftValue(value) // Do not emit native boxes — wrap them in Swift Foundation boxes instead.
195-
} else {
196-
return boxed as! NSObject
197-
}
198-
#else
199-
return (value as AnyObject) as! NSObject
200-
#endif
190+
let boxed = (value as AnyObject)
191+
if boxed is NSObject {
192+
return boxed as! NSObject
193+
} else {
194+
return __SwiftValue(value) // Do not emit native boxes — wrap them in Swift Foundation boxes instead.
195+
}
201196
}
202197
}
203198

0 commit comments

Comments
 (0)