[pycharm] create PyNarrowedType explicitly for TypeGuard and TypeIs PY-74277

GitOrigin-RevId: fe01878d76473c3c149ca520bf7978be49bfd097
This commit is contained in:
Vladimir Koshelev
2024-08-22 14:23:05 +02:00
committed by intellij-monorepo-bot
parent 7cf7de79f5
commit 8f1f5d99a4
16 changed files with 295 additions and 74 deletions

View File

@@ -59,12 +59,27 @@ public interface PyCallable extends PyAstCallable, PyTypedElement, PyQualifiedNa
@Nullable
PyType getCallType(@NotNull TypeEvalContext context, @NotNull PyCallSiteExpression callSite);
/**
* Please use getCallType with four arguments instead
*/
@Nullable
@Deprecated(forRemoval = true)
default PyType getCallType(@Nullable PyExpression receiver,
@NotNull Map<PyExpression, PyCallableParameter> parameters,
@NotNull TypeEvalContext context) {
return getCallType(receiver, null, parameters, context);
}
/**
* Returns the type of the call to the callable where the call site is specified by the optional receiver and the arguments to parameters
* mapping.
*/
@Nullable
PyType getCallType(@Nullable PyExpression receiver, @NotNull Map<PyExpression, PyCallableParameter> parameters,
PyType getCallType(@Nullable PyExpression receiver,
@Nullable PyCallSiteExpression pyCallSiteExpression,
@NotNull Map<PyExpression, PyCallableParameter> parameters,
@NotNull TypeEvalContext context);
/**