Skip to content

Commit bbcbcef

Browse files
authored
Python: Add false negative test case.
1 parent 233ae5a commit bbcbcef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/ql/test/query-tests/Variables/unused/type_annotation_fp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ def type_annotation(x):
99
else:
1010
foo : float
1111
do_other_stuff_with(foo)
12+
13+
def type_annotation_fn():
14+
# False negative: the value of `bar` is never used, but this is masked by the presence of the type annotation.
15+
bar = 5
16+
bar : int

0 commit comments

Comments
 (0)