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

unawaited_futures: False positives -> '.then' #57500

Closed
matanlurey opened this issue Mar 27, 2017 · 8 comments
Closed

unawaited_futures: False positives -> '.then' #57500

matanlurey opened this issue Mar 27, 2017 · 8 comments
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. linter-false-positive type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@matanlurey
Copy link
Contributor

matanlurey commented Mar 27, 2017

This should not trigger a lint warning:

new File('someFile.txt').readAsString().then(print);

But it does. On top of it, I can't ignore the lint warning at all:

// ignore: unawaited_futures
new File('someFile.txt').readAsString().then(print);

If this can't be fixed I'm request the lint be disabled for the next SDK release.

@matanlurey matanlurey added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Mar 27, 2017
@matanlurey matanlurey changed the title await_only_futures: False negatives when '.then' is used to chain unawaited_futures: False positives -> '.then' Mar 27, 2017
@matanlurey
Copy link
Contributor Author

EDIT: Looks like restarting analysis does "fix" it, temporarily. New warnings are not ignorable until you restart again, though, and it sort of still presents itself as you code/add more.

@matanlurey
Copy link
Contributor Author

Ping.

This is really annoying. I'd prefer this fixed before new lints are added if that's reasonable.

@alexeieleusis
Copy link
Contributor

alexeieleusis commented Mar 28, 2017 via email

@matanlurey
Copy link
Contributor Author

Where is the quick fix support? That's part of the linter?

@bwilkerson
Copy link
Member

Quick fixes lives in the analysis_server package.

@pq pq added linter-false-positive type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jun 27, 2018
@natebosch
Copy link
Member

@bwilkerson - is there a reasonable chance of getting a quickfix that wraps the future with a call to unawaited from package:pedantic?

@bwilkerson
Copy link
Member

I have no problem having such a fix added; it's merely a question of priorities and resources.

@matanlurey
Copy link
Contributor Author

I haven't seen an issue with this.

@devoncarew devoncarew added analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. linter-false-positive type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

6 participants