@Override
  default @NotNull DfType castTo(@NotNull PsiPrimitiveType type) {
    if (getConstantOfType(Object.class) != null) {
      return DfPrimitiveType.super.castTo(type);
    }
    if (type.equals(PsiTypes.doubleType()) || type.equals(PsiTypes.floatType())) {
      // No widening support for doubles, so we translate the wide range 
      // to avoid diverged states if (int)(double)x cast is performed
      LongRangeSet range = getWideRange();
      if (range.isEmpty()) return DfType.BOTTOM;
      return type.equals(PsiTypes.doubleType()) ? 
             DfTypes.doubleRange(range.min(), range.max()) :
             DfTypes.floatRange(range.min(), range.max());
    }
    if (!TypeConversionUtil.isIntegralNumberType(type)) {
      return DfPrimitiveType.super.castTo(type);
    }
    LongRangeSet range = JvmPsiRangeSetUtil.castTo(getRange(), type);
    LongRangeSet wideRange = JvmPsiRangeSetUtil.castTo(getWideRange(), type);
    return type.equals(PsiTypes.longType()) ? DfTypes.longRange(range, wideRange) : DfTypes.intRange(range, wideRange);
  }
@Override
  default @NotNull DfType castTo(@NotNull PsiPrimitiveType type)