Skip to content

Add option to the analyzer (also in Editor) that specifies to assume that the keyword "var" is a type inferred specifier #17945

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


Add option to the analyzer (also in Editor) that specifies to assume that the keyword in an type inferred specifier.

Sample code and explanation.

void main() {
  var i = 0;
  i = "";
}

Option turned off (current behavior):
No warrning, because "var" is dynamic type alias.

Option turned on.
Warning: "A value of type 'String' cannot be assigned to a variable of type 'int'".

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work ondevexp-warningIssues with the analyzer's Warning codeslegacy-area-analyzerUse area-devexp instead.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