[swift-dev] This little program currently compiles fine, but should it?

Johan Jensen jj at johanjensen.dk
Mon Dec 14 12:40:12 CST 2015


Because currently only unused variable/constant declarations have
warnings/fix-its attached to them.
There have been some discussion on making non-void functions warn of unused
results
<https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001580.html>
and it’s possible that this would be in style with that.
Perhaps (basically) empty statements should also give a warning?

—Johan

On Mon, Dec 14, 2015 at 7:08 PM, Jens Persson via swift-dev <
swift-dev at swift.org> wrote:

> func ok() {
>     let s = "see"; "Why are there exactly "
>     0 == 0 * 42
>     "warnings and errors in this code"
>     let t = s + "?"
>     print(t)
> }
> ok() // see?
>
>
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151214/556429a0/attachment.html>


More information about the swift-dev mailing list