PY-13276 Remove PyKnownDecoratorUtil.hasChangingReturnTypeDecorator and its usages

GitOrigin-RevId: d84b7be4dc850d704bd41b61d65e5b77ccd132ce
This commit is contained in:
Mikhail Golubev
2025-11-26 16:49:49 +00:00
committed by intellij-monorepo-bot
parent 677281f494
commit 9cb03803e1
2 changed files with 0 additions and 12 deletions
@@ -145,11 +145,6 @@ public final class PyKnownDecoratorUtil {
return !allDecoratorsAreKnown(decoratable, decorators) || decorators.contains(UNITTEST_MOCK_PATCH);
}
public static boolean hasChangingReturnTypeDecorator(@NotNull PyDecoratable decoratable, @NotNull TypeEvalContext context) {
final List<PyKnownDecorator> decorators = getKnownDecorators(decoratable, context);
return ContainerUtil.exists(decorators, d -> d == UNITTEST_MOCK_PATCH);
}
public static boolean hasUnknownOrUpdatingAttributesDecorator(@NotNull PyDecoratable decoratable, @NotNull TypeEvalContext context) {
final List<PyKnownDecorator> decorators = getKnownDecorators(decoratable, context);
@@ -1103,13 +1103,6 @@ public final class PyTypeChecker {
if (type == null || (genericsAreUnknown && type instanceof PyTypeParameterType)) {
return true;
}
if (type instanceof PyFunctionType) {
final PyCallable callable = ((PyFunctionType)type).getCallable();
if (callable instanceof PyDecoratable &&
PyKnownDecoratorUtil.hasChangingReturnTypeDecorator((PyDecoratable)callable, context)) {
return true;
}
}
if (type instanceof PyUnionType union) {
if (!PyUnionType.isStrictSemanticsEnabled()) {
return ContainerUtil.exists(union.getMembers(), member -> isUnknown(member, genericsAreUnknown, context));