Closed mkorbel1 closed 2 weeks ago
Summary: The Dart analyzer incorrectly flags a private getter in a mixin as unused, even though it's overridden and used in a subclass. This leads to a false positive warning, suggesting the getter can be removed, despite impacting program execution.
Good catch. This is a duplicate of https://github.com/dart-lang/sdk/issues/49354.
The below code reproduces the issue:
Running
dart analyze
highlights this issue:The messages are referring to
_myGetter
inBase
andBaseMixin
. However, executing the main function prints1
.So clearly the version of
_myGetter
inBaseMixin
is referenced and used. The functionality of the program is as expected, but the analyzer is giving a bad warning that it can be removed fromBaseMixin
, even though it impacts the execution of the program.I'm running in WSL2 Ubuntu, Dart SDK (no Flutter)