Confusing reference to inheritance in error message about member conflict #34274
Labels
improve-diagnostics
Related to the quality of diagnostic messages
legacy-area-front-end
Legacy: Use area-dart-model instead.
P2
A bug or feature request we're likely to work on
Consider the following test (excerpt from co19 test
Language/Classes/Instance_Methods/same_name_setter_t01.dart
):With
dart2js
(I'm usingarea-front-end
because I assume that the behavior is predominantly determined in the front end), we get the following response:It is correct to flag the given situation as an error, but it is confusing to claim that there is any involvement of inheritance: The two conflicting members are both declared in
C
, and the only superclass relationship is the one toObject
, andObject
has no member whose basename isfoo
.So I believe that the given error message should avoid mentioning inheritance in this situation.
PS: This comment of #21201 says 'This is indeed fixed with the unified frontend', and this issue basically says "Not quite!", in the sense that the error is flagged, but the error message is misleading. It might be useful to check out what was done for #21201 when fixing this issue, because it should be concerned with the same parts of the implementation.
The text was updated successfully, but these errors were encountered: