[swift-evolution] Shorthand unwrap proposal
Dmitri Gribenko
gribozavr at gmail.com
Fri Jun 24 04:34:35 CDT 2016
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.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the swift-evolution
mailing list