Skip to content

Rename doesn't handle named super parameters #60182

@johnniwinther

Description

@johnniwinther

When using the Rename refactoring in IntelliJ IDEA, I found that named super parameters were not updated when the super class and the subclass were in different libraries. For instance for

// lib1.dart
class A {
  int field;
  A({required this.field});
}

// lib2.dart
import 'lib1.dart';
class B extends A {
  B({required super.field});
}

renaming field to field2 would only change the names in A, leaving an error in B:

// lib1.dart
class A {
  int field2;
  A({required this.field2});
}

// lib2.dart
import 'lib1.dart';
class B extends A {
  B({required super.field}); // Error 
}

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-refactoringIssues with analysis server refactorings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions