Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzer incorrectly issues "unused" warning on variables being used by ??= #27705

Closed
martin88l opened this issue Oct 31, 2016 · 1 comment
Closed
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@martin88l
Copy link

The following has an unused warning on the variable _a:
import 'dart:async';
class A {
var _a;

void doSomething() {
_a ??= new Future(() => _a = null);
}
}

However, _a is used with ??= so that we don't create multiple futures doing the same work.

@bwilkerson bwilkerson added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-warning Issues with the analyzer's Warning codes P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Oct 31, 2016
dart-bot pushed a commit that referenced this issue Jul 15, 2020
Bug: #42668 and
Change-Id: Ic6f7b513d8c938be4dc60b9d154e532bad754d58
#27705
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
@pq
Copy link
Member

pq commented Sep 24, 2021

This looks fixed to me (maybe in 6c7eeb2?). (I can no longer reproduce.)

@pq pq closed this as completed Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants