Closed
Description
Problem
In Dart 3.7.2, when I declare a private interface method that I implement in some other classes, the Dart analyzer complains that it isn't referenced.
The declaration `_foo` isn't referenced.
Repro
Here's a DartPad that demonstrates the issue. I'll also paste the code here for clarity.
void main() {
Bar().bar();
}
final class Bar {
final foo = Foo();
void bar() {
foo._foo();
}
}
final class Foo implements _Foo {
@override
void _foo() {}
}
abstract interface class _Foo {
void _foo();
}
Additional Info
When using VS Code, it seems like the analyzer knows that _foo
is used elsewhere because I can jump to implementors and callers. I assume that's powered by the analyzer too, so it's odd that this error is present.