You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
The analyzer incorrectly flags the following (admittedly strange) code with a use-before-def error/warning.
The problem is due to a somewhat hacky piece of code in DDG.Walk(AssignmentStatement node) that attempts to detect the case "fob = fob" and temporarily manipulate the scope before evaluating the RHS of the assignment. This hack is problematic for a number of reasons. For example, it doesn't properly handle other more complex expressions like "fob = fob + 1".
I think the preferable solution is to remove the hack but modify the logic to allow reading of symbols in outer scopes even if VisibleToChildren is false. This property should probably be renamed WritableByChildren since Python allows reading of symbols from outer scopes.
The text was updated successfully, but these errors were encountered:
erictraut
changed the title
PLS incorrectly reports error for self-assignment to input parameters
PLS incorrectly reports error for self-assignment to local variable
Dec 26, 2018
We are not actively developing current analysis code as per #425 we are replacing DDG analysis (user files) and AST analysis (libraries) by a combination. The new analysis code base is in development, partial is here #465. It is a separate code, we just keep existing code around so we can check behavior and port tests.
If you install ZenHub in Chrome, you will be able to better see epics and the milestone board.
The analyzer incorrectly flags the following (admittedly strange) code with a use-before-def error/warning.
The problem is due to a somewhat hacky piece of code in
DDG.Walk(AssignmentStatement node)
that attempts to detect the case "fob = fob" and temporarily manipulate the scope before evaluating the RHS of the assignment. This hack is problematic for a number of reasons. For example, it doesn't properly handle other more complex expressions like "fob = fob + 1".I think the preferable solution is to remove the hack but modify the logic to allow reading of symbols in outer scopes even if
VisibleToChildren
is false. This property should probably be renamedWritableByChildren
since Python allows reading of symbols from outer scopes.See the following documentation in section 2.1 of the official Python docs.
The text was updated successfully, but these errors were encountered: