Skip to content

discarded_futures false positive? #59387

Closed
@wujek-srujek

Description

@wujek-srujek

Describe the issue
A possible false positive for the discarded_futures lint.

To Reproduce

Stream<int> foo() {
  return Stream.fromFuture(futureInt()); // <== lint
}

Future<int> futureInt() => Future.value(17);

Expected behavior
I think the lint shouldn't be triggered, the Future isn't discarded, it is consumed by Stream.fromFuture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-false-negativeIssues related to lint rules that fail to report a problem.linter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions