Open
Description
See https://dart.dev/tools/linter-rules/avoid_setters_without_getters. What if we have this:
class C {
int get x => 1;
}
extension type E(C it) implements C {
set x(int newValue) => it.x = newValue;
}
Should avoid_setters_without_getters
fire on this extension type? I think not... But maybe? Imagine a more realistic example where C subclasses another class D, and the extension type exposes (implements) D, and get x
is declared on D.
Also imagine an example where E implements another extension type, and get x
is declared on that extension type.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
bwilkerson commentedon Sep 21, 2023
The lint's documentation isn't very clear, but it seems to me that the lint shouldn't flag a setter if the members of the container include a getter with the same base name, no matter how the getter is a member (inheritance, exposure, etc.).