Skip to content

prefer_for_elements_to_map_fromIterable reports violation only when both key and value params are present #58323

Open
@tijoforyou

Description

@tijoforyou

Describe the issue
prefer_for_elements_to_map_fromIterable reports violation only when both key and value params are present

To Reproduce

// This is linted.
var m = Map.fromIterable(iter, key: (k) => k, value: (v) => v); 

// These are not linted, but should be?
var m = Map.fromIterable(iter, key: (k) => k);
var m = Map.fromIterable(iter, value: (v) => v);

// This is also not linted, but may be okay?
var m = Map.fromIterable(iter);

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.customer-google3devexp-linterIssues with the analyzer's support for the linter packagelinter-false-negativeIssues related to lint rules that fail to report a problem.linter-set-recommendedtype-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