• 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
Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'


  • Subject: Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 27 Jul 2015 22:06:41 +0000

On Jul 27, 2015, at 14:57 , Rick Mann <email@hidden> wrote:
>
> error: 'Bool' is not convertible to 'BooleanLiteralConvertible'
>    let d1 = [ kSecReturnData : true ]
>                                ^~~~
> error: '_' is not convertible to 'CFString'
>    let d2 = [ kSecReturnData : Bool(booleanLiteral: true) ]
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For d1, the reported error is a secondary error. The real error is the same as the error for d2.

The problem is that kSecReturnData is a CFString, which is not a type that’s bridged automatically in the construction of a dictionary. The following works for me in a playground (b4):

	let d1 = [ kSecReturnData as NSString : true ]



_______________________________________________

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: Marco S Hyman <email@hidden>
    • Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
      • From: Rick Mann <email@hidden>
References: 
 >'Bool' is not convertible to 'BooleanLiteralConvertible' (From: Rick Mann <email@hidden>)

  • Prev by Date: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • Next by Date: Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • Previous by thread: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • Next by thread: Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
  • Index(es):
    • Date
    • Thread