Open bwilkerson opened 7 months ago
I think that's intentional. Or a known limitation. In the latter example, we have a variable, such that we can track whether it is canceled. In the former example, we don't, so we throw our hands up. But I could see it being a false negative.
Yeah, if it isn't assigned to a variable, and it isn't passed as an argument to an invocation, then I think we can conclude that it isn't cancelled.
I don't know that I care deeply about it; I was just surprised when I discovered that it didn't get reported. (I was writing an example, and adding the variable creates an unused_local_variable
diagnostic, which is unfortunate for my purposes.)
If you're not expecting errors, or is using cancelOnError: true
, consider using stream.forEach(...)
instead.
(Then you'll get yelled at for not handling the returned future, which you probably should, instead of using an onDone
handler.)
Is it expected that the lint
cancel_subscriptions
does not generate a diagnostic for the following codebut will generate a diagnostic for the following code:
@pq @srawlins