Skip to content

"Add type annotations" doesn't handle dynamic correctly #56730

Open
@gspencergoog

Description

@gspencergoog

In VSCode, when I use the code suggestion "Add type annotations" and the type includes dynamic, then it will insert <> instead of <dynamic>. I think this feature uses analyzer, which is why I filed this here.

For instance, if I have the following declaration:

final List<dynamic> data = [];

and I invoke "Add type annotation", it produces:

final List<dynamic> data = <>[];

instead of the expected:

final List<dynamic> data = <dynamic>[];

Dart version

  • Dart 3.6.0-175.0.dev (dev) (Fri Aug 23 09:07:06 2024 -0700) on "linux_x64"
  • on linux / Linux 6.9.10-1rodete4-amd64 Process tests sometimes cause timeout on Linux #1 SMP PREEMPT_DYNAMIC Debian 6.9.10-1rodete4 (2024-08-02)
  • locale is en_US.UTF-8
  • Dart VSCode extension: v3.96.0

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-quick-fixIssues with analysis server (quick) fixestype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions