List<PyClassLikeType> (@NotNull TypeEvalContext context) { return PyUtil.getParameterizedCachedValue(this, context, contextArgument -> { List<PyClassLikeType> ancestorTypes; if (isNewStyleClass(contextArgument)) { try { ancestorTypes = getMROAncestorTypes(contextArgument); } catch (final MROException ignored) { ancestorTypes = getOldStyleAncestorTypes(contextArgument); boolean hasUnresolvedAncestorTypes = false; for (PyClassLikeType type : ancestorTypes) { if (type == null) { hasUnresolvedAncestorTypes = true; break; } } if (!hasUnresolvedAncestorTypes) { ancestorTypes = Collections.singletonList(null); } } } else { ancestorTypes = getOldStyleAncestorTypes(contextArgument); } return ancestorTypes; }); }