Resolving local variables in inherited classes