> > strong +1 from me. @warn_unused_result is almost always the right answer > in the standard library, and the few cases where it isn’t are very easy to > notice (when the call has side-effects and the return value is incidental). > > -Dave >
I'm also in favour of this proposal. Some days ago, in the swift-dev list ( https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000385.html ) I was advised by Chris Lattner to bring a related issue into this discussion: It's about the lack of a warning for simple statements that are unused and thus meaningless (so most probably unintentional). To demonstrate what I mean, 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?" } I think it might be reasonable to expect a warning on every single line of that function, no? /Jens
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
