> here's a short example that currently compiles without any warnings:
> 
> func thisFuncHasNoWarnings(a: Int) {
>     a
>     "b"
>     "c" as Character
>     1.0
>     [2.0, 3.0]
>     ["four", 5, 6.7] as [Any]
>     "Is this"; a; "problem?"
> }

And what would be the benefit of those warnings?
How about
for i in 1…1000000 {}
Equally stupid - should we have a warning for this as well?

Or
if (answer == true) {
…
} else if (answer == false) {
…
}
(really have seen something similar in the wild - I just don't remember if 
there has been an else clause as well ;-)

It is fine to aid inexperienced coders with concise warnings, but for me, the 
proposal is merely a burden for those who know what they are doing.
I wouldn't object against having the analyzer generate such warnings, though.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to