Python: Small rewrite of **kwargs getParameter logic

This commit is contained in:
Rasmus Wriedt Larsen
2023-01-30 09:42:43 +01:00
committed by GitHub
parent cef933f813
commit a1c2f4c138

View File

@@ -351,15 +351,10 @@ abstract class DataFlowFunction extends DataFlowCallable, TFunction {
// synthetic to the real. It might seem more natural to do it in the other
// direction, but since we have a clearStep on the real **kwargs parameter, we that
// content-clearing would also affect the synthetic parameter, which we don't want.
(
not exists(func.getArgByName(_)) and
ppos.isDictSplat() and
result.getParameter() = func.getKwarg()
or
exists(func.getArgByName(_)) and
ppos.isDictSplat() and
result = TSynthDictSplatParameterNode(this)
)
ppos.isDictSplat() and
if exists(func.getArgByName(_))
then result = TSynthDictSplatParameterNode(this)
else result.getParameter() = func.getKwarg()
}
}