Skip to content

Issue with lint unnecessary_await_in_return #57934

Closed
dart-archive/linter
#1531
@gabrc

Description

@gabrc

In the code below, await is necessary.

import 'dart:async';

Future<num> foo() async => 1;

// The lint unnecessary_await_in_return reports an issue here, but the await is necessary
// as an implicit downcast is necessary.
// We cannot change the code to `Future<int> bar() => foo()`
Future<int> bar() async => await foo();

void main() async => print(await bar());

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.linter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions