Description
Edit, Nov 24 2023: This issue has been retargeted, and it is no longer about improving the diagnostic message for a certain method/setter conflict. Instead, the language was modified such that those conflicts do not exist any more, and this issue is now the implementation issue for the new rules.
As such, this is now the analyzer specific issue for #53717.
This is the analyzer specific issue for #53717. Consider the following example:
extension type E1(int i) {
set m(_) {}
}
extension type E2(int i) implements E1 {
void m() {}
}
void main() {
E2(1).m = 10;
}
The analyzer reports the following error for the example, which is from #53717:
Class 'E2' can't define method 'm' and have field 'E1.m' with the same name.
This is confusing because there are no instance variable declarations named m
anywhere in this program. It would probably be helpful to report something like "Class 'E2' can't define method 'm' and have a setter 'E1.m' with the same name".
(The language specification documents would say that the name of the setter is m=
rather than m
, but presumably the analyzer error messages consider setters to have names like m
in general, without the =
.)