Skip to content

Bind all parameters to fields assist readds existing fields #62029

@FMorschel

Description

@FMorschel

If I have this code (newly added newField):

class SubtypeNaming {
  const SubtypeNaming({
    this.prefix,
    this.suffix,
    this.containing,
    bool newField = false,
  });

  final String? prefix;
  final String? suffix;
  final String? containing;
}

And I use Bind all parameters to fields, this is the output:

class SubtypeNaming {
  const SubtypeNaming({
    this.prefix,
    this.suffix,
    this.containing,
    this.newField = false,
  });

  final String? prefix;
  final String? suffix;
  final String? containing;

  final String? suffix;

  final String? containing;

  final bool newField;
}

I'm not sure why, but it readds existing fields. Also, I couldn't figure out why it skipped prefix in this operation.

Would you like to work on this, @mosuem? If you don't, I'll happily do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-refactoringIssues with analysis server refactoringstype-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