Skip to content

Commit bea0700

Browse files
committed
Python: Expand captured-variable test with default param
1 parent 14caaf1 commit bea0700

File tree

1 file changed

+13
-0
lines changed
  • python/ql/test/experimental/dataflow/typetracking

1 file changed

+13
-0
lines changed

python/ql/test/experimental/dataflow/typetracking/test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ def foo():
6565
also_x = foo() # $ tracked
6666
print(also_x) # $ tracked
6767

68+
69+
def from_parameter_default():
70+
x_alias = tracked # $tracked
71+
def outer(x=tracked): # $tracked
72+
print(x) # $tracked
73+
def inner():
74+
print(x) # $ MISSING: tracked
75+
print(x_alias) # $tracked
76+
return x # $tracked
77+
also_x = outer() # $tracked
78+
print(also_x) # $tracked
79+
80+
6881
# ------------------------------------------------------------------------------
6982
# Function decorator
7083
# ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)