• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
'Bool' is not convertible to 'BooleanLiteralConvertible'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'Bool' is not convertible to 'BooleanLiteralConvertible'


  • Subject: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • From: Rick Mann <email@hidden>
  • Date: Mon, 27 Jul 2015 14:57:44 -0700

In the following code,

    import Foundation

    let d1 = [ kSecReturnData : true ]
    let d2 = [ kSecReturnData : Bool(booleanLiteral: true) ]
    let d3 = [ kSecReturnData as String : Bool(booleanLiteral: true) ]
    let d4 : [NSObject:AnyObject] = [ kSecReturnData : true ]

error: 'Bool' is not convertible to 'BooleanLiteralConvertible'
    let d1 = [ kSecReturnData : true ]
                                ^~~~
error: '_' is not convertible to 'CFString'
    let d2 = [ kSecReturnData : Bool(booleanLiteral: true) ]
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Looking at the declaration for BooleanLiteralConvertible, that seems to be the only thing it would support.

What does the second one even mean?

And is d3 or d4 really the way to do this?

TIA,

--
Rick Mann
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Updating a screensaver from 10.6 to 10.10
  • Next by Date: Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • Previous by thread: Re: CGFloat and literal floats in Swift
  • Next by thread: Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • Index(es):
    • Date
    • Thread