Hint if a final field "overrides" non-final field #25567
Labels
devexp-linter
Issues with the analyzer's support for the linter package
legacy-area-analyzer
Use area-devexp instead.
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
If a final field "overrides" a non-final field, the setter for the superfield becomes a black hole eating all values assigned to the field, never to be seen again.
For extra style points, the hint could be omitted if the setter is also explicitly overridden and/or the super field is accessed using super, because that indicates the user knows what he is doing. Without those indicators, I would argue it is certainly a bug, and we could save the user from one of those "wtf moments" that Dart wasn't supposed to have.
Of course, using fields to "override" other fields is kind of a grotesque coding style in general, so it might be better to just always hint about this.
The text was updated successfully, but these errors were encountered: