Re: [swift-users] Decimal imported as NSDecimal not NSDecimalNumber in Swift 3 to Objective C

2016-11-14 Thread Nevin Brackett-Rozinsky via swift-users
Literals in Swift do not inherently have a type (at least conceptually). They are simply literals. The compiler will interpret them as whatever ExpressibleBy_Literal type is required to make the expression sensible. There are default types which literals will become if no type information is

Re: [swift-users] Decimal imported as NSDecimal not NSDecimalNumber in Swift 3 to Objective C

2016-11-14 Thread Chris Anderson via swift-users
Thanks for that follow up, I’m still a little confused at why one direction works and the other does not, but I’m getting there. I’ve found another issue I’ll bug report, but it’s along the same lines and wanted to run it by this thread. If I have an NSDecimalNumber, in Swift, and perform math

Re: [swift-users] Decimal imported as NSDecimal not NSDecimalNumber in Swift 3 to Objective C

2016-11-11 Thread Philippe Hausler via swift-users
NSDecimal is not toll free bridged, but it does have a bridge to NSDecimalNumber. So take this for example: @objc class Exam: NSObject { var grade: Double = 90.0 } It would be reasonable to expect that is exposed in objc as: @interface Exam : NSObject @property double grade; @end

Re: [swift-users] Decimal imported as NSDecimal not NSDecimalNumber in Swift 3 to Objective C

2016-11-11 Thread Adam C. Lickel via swift-users
NSDecimal has toll-free bridging with NSDecimalNumber so you can still do as casting when talking to an Objective-C API. > On Nov 11, 2016, at 2:56 PM, Chris Anderson via swift-users > wrote: > > Sure thing. Yeah, ideally the bridging would be fixed, but at the least,

Re: [swift-users] Decimal imported as NSDecimal not NSDecimalNumber in Swift 3 to Objective C

2016-11-11 Thread Tony Parker via swift-users
Hi Chris, Can you file a radar or JIRA for us on this? It looks like something should be fixed in the documentation at least, or perhaps in the bridging. - Tony > On Nov 11, 2016, at 1:46 PM, Chris Anderson via swift-users > wrote: > > I'm having problems with the

[swift-users] Decimal imported as NSDecimal not NSDecimalNumber in Swift 3 to Objective C

2016-11-11 Thread Chris Anderson via swift-users
I'm having problems with the type conversion between a Swift `Decimal` and an Objective C `NSDecimalNumber`. If I have the Swift class: @objc class Exam: NSObject { var grade: Decimal = 90.0 } And try to use that Swift class in Objective C, Exam *exam = [[Exam alloc] init];