"Find uses" fails to account for static binding of super invocations. #19694
Labels
analyzer-server
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
With the following code:
class A {
f() { }
}
class B extends A {
f() {
super.f();
}
}
class C extends B {
f() {
super.f();
}
}
"Find uses" on A.f() shows B.f() and C.f(). This is incorrect--C.f() does not call A.f().
"Find uses" on B.f() shows B.f() and C.f(). This is incorrect--B.f() does not call itself.
"Find uses" on C.f() shows B.f() and C.f(). This is incorrect--neither B.f() nor C.f() calls C.f().
It appears that "find uses" is failing to account for the fact that super invocations are not dynamic--they look up the callee in the superclass of the immediately enclosing class, regardless of the dynamic type of the object.
The text was updated successfully, but these errors were encountered: