Skip to content

Commit f91e826

Browse files
authored
Python: Add test case
1 parent d282f6a commit f91e826

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

python/ql/test/query-tests/Variables/undefined/UninitializedLocal.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
| UninitializedLocal.py:163:7:163:7 | x | Local variable 'x' may be used before it is initialized. |
1212
| UninitializedLocal.py:176:16:176:16 | x | Local variable 'x' may be used before it is initialized. |
1313
| 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. |
1415
| odasa3987.py:11:8:11:10 | var | Local variable 'var' may be used before it is initialized. |

python/ql/test/query-tests/Variables/undefined/UninitializedLocal.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,8 @@ def avoid_redundant_split(a):
288288
var = False
289289
if var:
290290
foo.bar() #foo is defined here.
291+
292+
def type_annotation_fp():
293+
annotated : annotation = [1,2,3]
294+
for x in annotated:
295+
print(x)

0 commit comments

Comments
 (0)