Skip to content

Questions on null_check_on_nullable_type_parameter #58666

Description

@srawlins

I was looking at test cases in order to implement a quick fix for null_check_on_nullable_type_parameter but came across some test cases that surprised me.

Future<T> / await p!:

Future<T> m40<T extends Object?>(T? p) async => await p!; // LINT

This case does not generate a lint report, but I expected it would.

List<T> / [p!]:

void ff<T>(T? p) {
  <T>[p!]; // LINT
}

This case also does not generate a lint report, but I expected it would.

Stream<T> / yield p!:

Stream<T> m41<T extends Object?>(T? p) async* { yield p!; }

This case also does not generate a lint report, but I expected it would.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-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-set-coretype-questionA question about expected behavior or functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions