Skip to content

specify_nonobvious_local_variable_types false positive with typedefs + type args #63485

@nate-thegrate

Description

@nate-thegrate
class Foo {}
typedef Bar = Foo;

void main() {
  var b = Bar();
}

No problems with the above code.


But if we add a type argument:

class Foo<T> {}
typedef Bar = Foo<Object?>;

void main() {
  var b = Bar();
}

According to the linter rule, b's type is no longer obvious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

    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