> On May 12, 2017, at 10:10 AM, Yarik Arsenkin via swift-evolution 
> <[email protected]> wrote:
> Hi,
> 
> does anyone know if there is a reason why bridging of the Swift’s `Int?` type 
> doesn’t work for Objective-C? I mean, it could be exposed as an `NSNumber` 
> with nullable attribute, no?

I assume you're talking about the type restrictions on exporting Swift 
functions as @objc.  We have the technical ability to bridge any Swift value to 
Objective-C as an opaque object, but that wouldn't actually produce meaningful 
APIs on the ObjC side; we have to have some sort of tighter policy than that.  
Today, that policy is to allow export when there's an obvious, idiomatic 
analogue in Objective-C.  Exporting Int? as an optional NSNumber does not feel 
obvious and idiomatic when we would export Int as NSInteger.  It feels like 
reaching for an arbitrary solution.

John.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to