async let
has the nice property that it will self-cancel if not awaited-upon on scope exit:
async
let timeout:Void = self.fail(request: id,
once: started.advanced(by: duration))
return try await withCheckedThrowingContinuation
{
...
}
but this generates a warning
warning: immutable value 'timeout' was never used; consider replacing with '_' or removing it
in swift 5.8 we can use async let
with the underscore and fix this warning:
async
let _:Void = self.fail(request: id, once: started.advanced(by: duration))
but this will not compile on 5.7.
is there any way to fix this problem so that the library compiles without warnings on both toolchains?