dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.28k stars 1.58k forks source link

`AMBIGUOUS_EXTENSION_MEMBER_ACCESS` fix doesn't trigger for methods #59543

Closed FMorschel closed 1 day ago

FMorschel commented 2 days ago

Even after https://github.com/dart-lang/sdk/issues/49489 got closed when we have a method this fix is not called.

void foo(int i) {
  0.0.foo();
  0.foo();
  i.foo();
}

extension E1 on num {
  void foo() {}
}

extension E2 on num {
  void foo() {}
}

Is there a specific reason for this @bwilkerson? As far as I know, methods are also members (I mean, the error does say so). I can open a CL to fix this if this is not intended.

dart-github-bot commented 2 days ago

Summary: The AMBIGUOUS_EXTENSION_MEMBER_ACCESS fix doesn't work for ambiguous extension method calls, despite the error message mentioning members. A fix might be needed.

bwilkerson commented 1 day ago

No, I don't know of any reason why the fix wouldn't trigger in those cases.

FMorschel commented 1 day ago

https://dart-review.googlesource.com/396741