Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
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