Skip to content

use_null_aware_elements could trigger for nullable spread cases too #62660

@FMorschel

Description

@FMorschel

Repro:

void f(List<Object>? nL, List<Object> l, int? i) {
  var _ = <Object>[
    ...l,
    ...?nL,
    if (nL != null) ...nL, // nothing but could be as above
    if (i != null) i, // use_null_aware_elements
    ?i,
  ];
}

CC @bwilkerson @kallentu

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.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions