File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
test/query-tests/Variables/undefined Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -653,6 +653,8 @@ class DefinitionNode extends ControlFlowNode {
653
653
DefinitionNode ( ) {
654
654
exists ( Assign a | a .getATarget ( ) .getAFlowNode ( ) = this )
655
655
or
656
+ exists ( AnnAssign a | a .getTarget ( ) .getAFlowNode ( ) = this and exists ( a .getValue ( ) ) )
657
+ or
656
658
exists ( Alias a | a .getAsname ( ) .getAFlowNode ( ) = this )
657
659
or
658
660
augstore ( _, this )
@@ -795,6 +797,9 @@ private AstNode assigned_value(Expr lhs) {
795
797
/* lhs = result */
796
798
exists ( Assign a | a .getATarget ( ) = lhs and result = a .getValue ( ) )
797
799
or
800
+ /* lhs : annotation = result */
801
+ exists ( AnnAssign a | a .getTarget ( ) = lhs and result = a .getValue ( ) )
802
+ or
798
803
/* import result as lhs */
799
804
exists ( Alias a | a .getAsname ( ) = lhs and result = a .getValue ( ) )
800
805
or
Original file line number Diff line number Diff line change 11
11
| UninitializedLocal.py:163:7:163:7 | x | Local variable 'x' may be used before it is initialized. |
12
12
| UninitializedLocal.py:176:16:176:16 | x | Local variable 'x' may be used before it is initialized. |
13
13
| UninitializedLocal.py:178:16:178:16 | y | Local variable 'y' may be used before it is initialized. |
14
- | UninitializedLocal.py:294:14:294:22 | annotated | Local variable 'annotated' may be used before it is initialized. |
15
14
| odasa3987.py:11:8:11:10 | var | Local variable 'var' may be used before it is initialized. |
You can’t perform that action at this time.
0 commit comments