Closed
Description
For the code below:
class Foo {
Object? value;
bool equals(Object other) => switch (other) {
Foo(: var value) => this.value == value,
_ => false
};
}
the 3.0.0 analyzer will print
info - test.dart:5:25 - Unnecessary 'this.' qualifier. Try removing 'this.'. - unnecessary_this
This is incorrect. The this.
is necessary to disambiguate the containing class's value
field from the value
variable bound by the switch
expression.
Metadata
Metadata
Assignees
Labels
A high priority bug; for example, a single project is unusable or has many test failuresIssues with the analyzer's support for the linter packageUse area-devexp instead.Issues related to lint rules that report a problem when it isn't a problem.Incorrect behavior (everything from a crash to more subtle misbehavior)