Skip to content

Quick-fix Wrap with extension override when overriding an existing member #61102

Open
@FMorschel

Description

@FMorschel

If an extension that overrides a built-in member is available in scope, could we allow a "Wrap with extension override" fix for it?

class A {
  int operator %(int other) => other;
  int get thing => 0;
}

void main() {
  var a = A();
  a % '';
  String str = a.thing;
}

extension AE on A {
  String operator %(String other) => other;
  String get thing => '';
}

We'd have to be smart about this, but I think it is doable.

CC @bwilkerson

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