private boolean checkTypes(PsiExpression expression, PsiType expressionType, PsiType convertedType) {
      if (expressionType.equals(convertedType)) return false;
      if (ignoreConstantConversions) {
        PsiExpression rootExpression = expression;
        while (rootExpression instanceof PsiParenthesizedExpression parenthesizedExpression) {
          rootExpression = parenthesizedExpression.getExpression();
        }
        if (rootExpression instanceof PsiLiteralExpression || PsiUtil.isConstantExpression(rootExpression)) {
          return false;
        }
      }
      if (ignoreCharConversions && isCharConversion(expressionType, convertedType)) return false;
      registerError(expression instanceof PsiAssignmentExpression
                    ? ((PsiAssignmentExpression)expression).getLExpression()
                    : expression,
                    expression, expressionType, convertedType);
      return true;
    }
private boolean checkTypes(PsiExpression expression, PsiType expressionType, PsiType convertedType)