Projects >> intellij-community >>0b41a2b921a090b417806e8d92ec4ec322d9c297

Chunk
Conflicting content
  protected abstract void updateText(boolean isReturn);

<<<<<<< HEAD
  protected boolean isTypeDefined(PyExpression problemElement) {
=======
  private static boolean isTypeUndefined(PyExpression problemElement) {
    final TypeEvalContext context = TypeEvalContext.fastStubOnly(problemElement.getContainingFile());
    final PyType type = context.getType(problemElement);
    if (type == null || type instanceof PyReturnTypeReference || type instanceof PyDynamicallyEvaluatedType) {
      PsiReference reference = problemElement.getReference();
      if (problemElement instanceof PyQualifiedExpression) {
        final PyExpression qualifier = ((PyQualifiedExpression)problemElement).getQualifier();
        if (qualifier != null && !qualifier.getText().equals(PyNames.CANONICAL_SELF)) reference = qualifier.getReference();
      }

      if (isDefinedInDocstring(problemElement, reference)) return false;
      return !isDefinedInAnnotation(problemElement, reference);
    }
    return false;
  }

  private static boolean isDefinedInAnnotation(PyExpression problemElement, PsiReference reference) {
    if (LanguageLevel.forElement(problemElement).isOlderThan(LanguageLevel.PYTHON30)) {
      return false;
    }
    final PsiElement resolved = reference != null? reference.resolve() : null;
    PyParameter parameter = getParameter(problemElement, resolved);

    if (parameter instanceof PyNamedParameter && (((PyNamedParameter)parameter).getAnnotation() != null)) return true;

    if (resolved instanceof PyTargetExpression) { // return type
      final PyExpression assignedValue = ((PyTargetExpression)resolved).findAssignedValue();
      if (assignedValue instanceof PyCallExpression) {
        final PyExpression callee = ((PyCallExpression)assignedValue).getCallee();
        if (callee != null) {
          final PsiReference psiReference = callee.getReference();
          if (psiReference != null && psiReference.resolve() == null) return false;
        }
        final Callable callable = ((PyCallExpression)assignedValue).resolveCalleeFunction(getResolveContext(problemElement));

        if (callable instanceof PyFunction && ((PyFunction)callable).getAnnotation() != null) return true;
      }
    }
>>>>>>> 0f4a97b4080b6f090e246cf1a0c66bde3ae2f044
    return false;
  }
Solution content
  protected abstract void updateText(boolean isReturn);

  protected boolean isTypeDefined(PyExpression problemElement) {
    return false;
  }
File
TypeIntention.java
Developer's decision
Version 1
Kind of conflict
If statement
Method declaration
Method invocation
Method signature
Variable