[swift-users] Nil coalescing operator and closures

Rudolf Adamkovic salutis at me.com
Wed Feb 24 13:49:42 CST 2016


Thanks for letting me know!

R+

Sent from my iPhone

> On 24 Feb 2016, at 18:54, Joe Groff <jgroff at apple.com> wrote:
> 
> 
>> On Feb 24, 2016, at 5:37 AM, Rudolf Adamkovič via swift-users <swift-users at swift.org> wrote:
>> 
>> Hello there!
>> 
>> Today, I stumbled upon the following error:
>> 
>> typealias ClosureType = () -> Void
>>         
>> let closure: ClosureType?
>> let otherClosure: ClosureType = {}
>>         
>> let pickClosure = closure ?? otherClosure
>> // ERROR: binary operator '??' cannot be applied to operands of type 'ClosureType?' and 'ClosureType' (aka '() -> ()')
>> 
>> Is this a bug or a feature?
> 
> It's a known bug.
> 
> -Joe
> 
>> 
>> Thanks!
>> 
>> Rudolf Adamkovic
>> R+
>> 
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160224/15f5cf00/attachment.html>


More information about the swift-users mailing list