Skip to content

Wrap with unawaited false-negative for nullable futures #61144

@FMorschel

Description

@FMorschel

Repro:

class A {
  Future<void> m() async {}
}

void foo(A? a) {
  a?.m();
  if (a != null) {
    a.m();
  }
  a!.m();
}

For all cases above, the first (a?.m()) doesn't show Wrap with unawaited, but it does accept Future<void>?.

This happens no matter if foo is async or not, so the problem is with the quick-fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-quick-fixIssues with analysis server (quick) fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions