[swift-evolution] Please remove obscure "!" requirements for implicitly unwrapped optionals
Amir Michail
a.michail at me.com
Thu Dec 3 18:03:28 CST 2015
> On Dec 3, 2015, at 6:49 PM, Chris Lattner <clattner at apple.com> wrote:
>
>
>> On Dec 3, 2015, at 3:10 PM, Amir Michail <a.michail at me.com> wrote:
>>
>> In particular, this should not be required in boolean contexts.
>>
>> Is there any good reason why certain contexts require the “!” suffix?
>
> ! is used to in multiple different ways for IUO’s. What specifically are you objecting to? Please give an example, thanks!
>
> -Chris
>
I really don’t like having to put the ! suffix in boolean contexts:
"if displayFlag! { ... }" instead of "if displayFlag { … }" etc.
If you also want a way to compare with nil, then maybe have this for implicitly unwrapped optionals:
if displayFlag? == nil { … }
More information about the swift-evolution
mailing list