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
<[email protected]> 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?

Otherwise we need to write boilerplate code:
_ = s.map {print($0)}


Dmitri

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to