Maybe<PyType> (@NotNull PyCallExpression call, @NotNull TypeEvalContext context) { final PyExpression callee = call.getCallee(); if (callee instanceof PyReferenceExpression) { PsiElement must_be_super = ((PyReferenceExpression)callee).getReference().resolve(); if (must_be_super == PyBuiltinCache.getInstance(call).getClass(PyNames.SUPER)) { final PyArgumentList argumentList = call.getArgumentList(); if (argumentList != null) { final PyClass containingClass = PsiTreeUtil.getParentOfType(call, PyClass.class); PyExpression[] args = argumentList.getArguments(); if (containingClass != null && args.length > 1) { PyExpression first_arg = args[0]; if (first_arg instanceof PyReferenceExpression firstArgRef) { final PyExpression qualifier = firstArgRef.getQualifier(); if (qualifier != null && PyNames.__CLASS__.equals(firstArgRef.getReferencedName())) { final PsiReference qRef = qualifier.getReference(); final PsiElement element = qRef == null ? null : qRef.resolve(); if (element instanceof PyParameter) { final PyParameterList parameterList = PsiTreeUtil.getParentOfType(element, PyParameterList.class); if (parameterList != null && element == parameterList.getParameters()[0]) { return new Maybe<>(getSuperCallTypeForArguments(context, containingClass, args[1])); } } } PsiElement possible_class = firstArgRef.getReference().resolve(); if (possible_class instanceof PyClass first_class && ((PyClass)possible_class).isNewStyleClass(context)) { return new Maybe<>(getSuperCallTypeForArguments(context, first_class, args[1])); } } } else if ((call.getContainingFile() instanceof PyFile) && ((PyFile)call.getContainingFile()).getLanguageLevel().isPy3K() && (containingClass != null)) { return new Maybe<>(getSuperClassUnionType(containingClass, context)); } } } } return new Maybe<>(); }