On Mon, Dec 21, 2015, at 11:17 PM, Brent Royal-Gordon wrote:
> > And that brings to mind a second question: How about functions that are
> > generic in their return type? For example,
> > `withExtendedLifetime(_: T, _: T throws -> Result) rethrows ->
> > Result`. The return type may
Also, one question that I haven't seen come up yet: Would this behavior change
affect closures? I'm inclined to say that closures that declare a type
explicitly should get this behavior (because it's easy to add
@allow_unused_result to those), but closures whose type is inferred should not
Hi All.
Being naive here (also very difficult to say this clearly and succinctly), but
why is this the choice of the writer of the function rather than the person
using the function?
That is, I would think that if I were worried about unused return results in my
code, I would have some kind
The idea is that the writer of the function is the one who can decide whether
or not the result of their function can be safely ignored. Imagine you wrote a
function in Swift:
func times(x: Int, y: Int) -> Int {
return x * y;
}
At the point of writing this function (though it may be a
I am also strongly in favor of this proposal.
There are probably enough valid use cases for a @suppress_unused_warning but
personally I don't think pop() is a great example.
I think a second method à la dropFirst/Last/... that returns Void would be
better at communicating intent and allows
> On 18 Dec 2015, at 23:23, Dave Abrahams wrote:
>>
>> I think a second method à la dropFirst/Last/... that returns Void would be
>> better at communicating intent and allows pop() to retain the warning.
>
> Those are non-mutating methods that don’t return Void, FWIW.
> On Dec 18, 2015, at 2:01 PM, Janosch Hildebrand via swift-evolution
> wrote:
>
> I am also strongly in favor of this proposal.
>
> There are probably enough valid use cases for a @suppress_unused_warning but
> personally I don't think pop() is a great example.
>