Python: Show getCallableForArgument can have multiple results

This commit is contained in:
Rasmus Wriedt Larsen
2020-11-18 10:43:26 +01:00
parent abf2902a69
commit ab856d6c01
2 changed files with 16 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ private predicate typePreservingStep(Node nodeFrom, Node nodeTo) {
}
/**
* Gets the callable for the call where `nodeFrom` is used as the `i`'th argument.
* Gets a callable for the call where `nodeFrom` is used as the `i`'th argument.
*
* Helper predicate to avoid bad join order experienced in `callStep`.
* This happened when `isParameterOf` was joined _before_ `getCallable`.

View File

@@ -0,0 +1,15 @@
def foo(foo_x): # $tracked
print("foo", foo_x) # $tracked
def bar(bar_x): # $tracked
print("bar", bar_x) # $tracked
if len(__file__) % 2 == 0:
f = foo
else:
f = bar
x = tracked # $tracked
f(x) # $tracked