@Override
  public void visitReferenceExpression(@NotNull PsiReferenceExpression expression) {
    final PsiExpression qualifierExpression = expression.getQualifierExpression();

    if (qualifierExpression != null && qualifierExpression.isPhysical()) {
      qualifierExpression.accept(this);

      final TypeView qualifierView = new TypeView(qualifierExpression);

      if (qualifierView.isChanged()) {
        final PsiMember member = (PsiMember)expression.advancedResolve(false).getElement();
        if (member == null) return;
        final Pair<PsiType, PsiType> typePair = qualifierView.getTypePair();

        final TypeConversionDescriptorBase conversion = myLabeler.getRules().findConversion(typePair.getFirst(), typePair.getSecond(), member, expression, false, myLabeler);

        if (conversion == null) {
          myLabeler.markFailedConversion(typePair.getSecond(), qualifierExpression);
        } else {
          final PsiElement parent = Util.getEssentialParent(expression);
          final PsiType type = conversion.conversionType();
          if (parent instanceof PsiMethodCallExpression) {
            myLabeler.setConversionMapping((PsiMethodCallExpression)parent, conversion);
            PsiType targetType = type != null ? type : myTypeEvaluator.evaluateType((PsiExpression)parent);
            if (targetType != null) {
              myTypeEvaluator.setType(new TypeMigrationUsageInfo(parent), targetType);
            }
          } else {
            myLabeler.setConversionMapping(expression, conversion);
            PsiType targetType = type != null ? type : myTypeEvaluator.evaluateType(expression);
            if (targetType != null) {
              myTypeEvaluator.setType(new TypeMigrationUsageInfo(expression), targetType);
            }
          }
        }
      }
    }
    else if (PsiUtil.isCondition(expression, expression.getParent())) {
      final TypeView view = new TypeView(expression);
      if (view.isChanged()) { //means that boolean condition becomes non-boolean
        findConversionOrFail(expression, expression, view.getTypePair());
      }
    }
  }
@Override
  public void visitReferenceExpression(@NotNull PsiReferenceExpression expression)