[swift-evolution] Shorthand unwrap proposal

Vladimir.S svabox at gmail.com
Fri Jun 24 08:16:45 CDT 2016


On 24.06.2016 12:34, Dmitri Gribenko wrote:
> On Fri, Jun 24, 2016 at 2:14 AM, Vladimir.S <svabox at gmail.com> wrote:
>> On 23.06.2016 19:26, Dmitri Gribenko via swift-evolution wrote:
>>>
>>> On Thu, Jun 23, 2016 at 9:25 AM, James Campbell via swift-evolution
>>> <swift-evolution at swift.org> wrote:
>>>>
>>>> So if the function I run inside of the map has a return value of Void
>>>> will
>>>> that still compile ?
>>>
>>>
>>> Yes.
>>
>>
>> Btw, in case of
>>
>> let s: String? = "hi"
>> s.map {print($0)}
>>
>> we have
>> warning: result of call to 'map' is unused
>> s.map {print($0)}
>>
>> Isn't it strange that result of call is Void, but we have a warning? Don't
>> we need to suppress warning in this case?
>
> This is a bug in the compiler.  IIRC someone said they were working on it.

Hmm.. OK, will check: https://bugs.swift.org/browse/SR-1895

>
> Dmitri
>


More information about the swift-evolution mailing list