Skip to content

convert_to_function_declaration fails for top level variables #61818

@AgamAgarwal

Description

@AgamAgarwal

Similar to #61815

Example:

final v1 = () => 42;

void f() {
  v1();
}

should be fixed to:

int v1() => 42;

void f() {
  v1();
}

Dart SDK version: 3.11.0-edge.945f32dfc76fd029f8a0e782107b4fc6aaefa924 (main) (Fri Oct 24 06:15:16 2025 -0700) on "macos_arm64"

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions