mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
PY-82707 Pycharm July 2025 EAP showing unreachable when using a subtype of Any
(cherry picked from commit c8a61ecc43754144679e5afc9f4623c02f558597) IJ-MR-170092 GitOrigin-RevId: 612862aa2ce338a8f18e13197f483b936c9d0cdb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7200369f16
commit
4c890f2d47
@@ -282,6 +282,7 @@ public class PyTypeAssertionEvaluator extends PyRecursiveElementVisitor {
|
||||
private static boolean match(@Nullable PyType expected, @Nullable PyType actual, @NotNull TypeEvalContext context) {
|
||||
return !(actual instanceof PyStructuralType) &&
|
||||
!PyTypeChecker.isUnknown(actual, context) &&
|
||||
!(PyTypeUtil.inheritsAny(actual, context)) &&
|
||||
PyTypeChecker.match(expected, actual, context);
|
||||
}
|
||||
|
||||
|
||||
@@ -182,4 +182,8 @@ public final class PyTypeUtil {
|
||||
new PyClassTypeImpl(superClass, false));
|
||||
return PyTypeChecker.convertToType(type, superClassType, context);
|
||||
}
|
||||
|
||||
public static boolean inheritsAny(@NotNull PyType type, @NotNull TypeEvalContext context) {
|
||||
return type instanceof PyClassLikeType classLikeType && classLikeType.getAncestorTypes(context).contains(null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user