diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll index 9ef775f7e3f..37eecb76d4c 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll @@ -308,9 +308,12 @@ predicate hasContextmanagerDecorator(Function func) { * Holds if the function `func` has a `typing.overload` decorator. * Such functions are type stubs that declare an overload signature but are * not the actual implementation. + * + * Normally we would want to model this using API graphs for more precision, but since this + * predicate is used in the call graph computation, we have to use a more syntactic approach. */ overlay[local] -predicate hasOverloadDecorator(Function func) { +private predicate hasOverloadDecorator(Function func) { exists(ControlFlowNode overload | overload.(NameNode).getId() = "overload" and overload.(NameNode).isGlobal() or