This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Description
Consider the following Python code:
class ContainerClass():
class BaseClass(object):
def __init__(self, name):
self.name = name
class SubClass(BaseClass):
def __init__(self):
super().__init__('')
The PLS analyzer logic incorrectly reports that BaseClass is referenced before being defined. In looking at the PLS code, AnalysisUnit.AnalyzeWorker is calling EvaluateBaseClass from within the scope of the subclass rather than its outer (containing) class.
I think this can be fixed by modifying AnalysisUnit.AnalyzeWorker to temporarily set the scope of the ddg to the outer scope before calling EvaluateBaseClass. Something like this:
// Evaluate base classes in the outer scope.
if (_outerUnit.Scope is InterpreterScope) {
ddg.Scope = _outerUnit.Scope as InterpreterScope;
}
bases.Add(EvaluateBaseClass(ddg, classInfo, i, baseClassArg.Expression));
ddg.Scope = InterpreterScope;