mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
[python] Introduce PyArgumentsMapping.isComplete
(cherry picked from commit 64dca74e18a2ae8c4a64f6730093e59dbef6b671) IJ-CR-146869 GitOrigin-RevId: 42cc87410c38c09a65b38d2ca9389474f17ae8b6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e31c88a59e
commit
09fa8a0611
@@ -286,7 +286,7 @@ public class PyTypeCheckerInspection extends PyInspection {
|
||||
private void checkCallSite(@NotNull PyCallSiteExpression callSite) {
|
||||
final List<AnalyzeCalleeResults> calleesResults = StreamEx
|
||||
.of(mapArguments(callSite, getResolveContext()))
|
||||
.filter(mapping -> mapping.getUnmappedArguments().isEmpty() && mapping.getUnmappedParameters().isEmpty())
|
||||
.filter(mapping -> mapping.isComplete())
|
||||
.map(mapping -> analyzeCallee(callSite, mapping))
|
||||
.nonNull()
|
||||
.toList();
|
||||
|
||||
@@ -399,7 +399,7 @@ class PyTypeHintsInspection : PyInspection() {
|
||||
val resolveContext = PyResolveContext.defaultContext(myTypeEvalContext)
|
||||
call
|
||||
.multiMapArguments(resolveContext)
|
||||
.firstOrNull { it.unmappedArguments.isEmpty() && it.unmappedParameters.isEmpty() }
|
||||
.firstOrNull { it.isComplete }
|
||||
?.let { mapping ->
|
||||
mapping.mappedParameters.entries.forEach {
|
||||
val name = it.value.name
|
||||
|
||||
@@ -1243,9 +1243,7 @@ public final class PyCallExpressionHelper {
|
||||
@NotNull PyCallSiteExpression callSite,
|
||||
@NotNull TypeEvalContext context) {
|
||||
final PyCallExpression.PyArgumentsMapping fullMapping = mapArguments(callSite, callable, context);
|
||||
if (!fullMapping.getUnmappedArguments().isEmpty() || !fullMapping.getUnmappedParameters().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (!fullMapping.isComplete()) return false;
|
||||
|
||||
// TODO properly handle bidirectional operator methods, such as __eq__ and __neq__.
|
||||
// Based only on its name, it's impossible to which operand is the receiver and which one is the argument.
|
||||
|
||||
Reference in New Issue
Block a user