Swiftyjson: cannot call value of non-function type 'NSDecimalNumber'

Created on 17 Jul 2016  路  4Comments  路  Source: SwiftyJSON/SwiftyJSON

I've got the following errors with swift 3 Apple Swift version 3.0 (swiftlang-800.0.33.1 clang-800.0.31) bundled with the Xcode Beta 2 and found the appropriate lines here:
https://github.com/SwiftyJSON/SwiftyJSON/blob/swift3/Source/SwiftyJSON.swift#L739

ompile Swift Module 'SwiftyJSON' (2 sources)
/Code/Kitura-Sample/Packages/SwiftyJSON-10.0.0/Source/SwiftyJSON.swift:1290:57: error: cannot call value of non-function type 'NSDecimalNumber'
                if decimal == NSDecimalNumber.notANumber() {  // indicates parse error
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~^~

/Kitura-Sample/Packages/SwiftyJSON-10.0.0/Source/SwiftyJSON.swift:1291:48: error: cannot call value of non-function type 'NSDecimalNumber'
                    return NSDecimalNumber.zero()
                           ~~~~~~~~~~~~~~~~~~~~^~

Most helpful comment

If you're still on Xcode 8b2, try my fork. Alas, it seems updating for 8b3 is going to be a little trickier but I'll see what I can do this afternoon.

All 4 comments

If you're still on Xcode 8b2, try my fork. Alas, it seems updating for 8b3 is going to be a little trickier but I'll see what I can do this afternoon.

any update for xcode 8 beta 3

Try this:

if decimal == NSDecimalNumber.notA {  // indicates parse error
    return NSDecimalNumber.zero
}

SwiftyJSON v3 was released with full support for Swift 3. Let me know if you need me to reopen this, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MrLoveQD picture MrLoveQD  路  5Comments

patchthecode picture patchthecode  路  3Comments

otaran picture otaran  路  7Comments

bloqlist picture bloqlist  路  7Comments

ejpusa picture ejpusa  路  5Comments