Skip to content

Commit 970fcf9

Browse files
authored
Merge pull request #2500 from zayass/patch-7
2 parents a69879f + 7e3ef45 commit 970fcf9

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

Sources/Foundation/Bridging.swift

Lines changed: 6 additions & 11 deletions
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)