public static boolean isExactPrimitiveWideningConversion(@NotNull PsiType type, @NotNull PsiType patternType) {
    if (type.equals(PsiTypes.byteType())) {
      return patternType.equals(PsiTypes.shortType()) ||
             patternType.equals(PsiTypes.intType()) ||
             patternType.equals(PsiTypes.longType()) ||
             patternType.equals(PsiTypes.floatType()) ||
             patternType.equals(PsiTypes.doubleType());
    }
    if (type.equals(PsiTypes.shortType())) {
      return patternType.equals(PsiTypes.intType()) ||
             patternType.equals(PsiTypes.longType()) ||
             patternType.equals(PsiTypes.floatType()) ||
             patternType.equals(PsiTypes.doubleType());
    }
    if (type.equals(PsiTypes.charType())) {
      return patternType.equals(PsiTypes.intType()) ||
             patternType.equals(PsiTypes.longType()) ||
             patternType.equals(PsiTypes.floatType()) ||
             patternType.equals(PsiTypes.doubleType());
    }
    if (type.equals(PsiTypes.intType())) {
      return patternType.equals(PsiTypes.longType()) ||
             patternType.equals(PsiTypes.doubleType());
    }
    if (type.equals(PsiTypes.floatType())) {
      return patternType.equals(PsiTypes.doubleType());
    }
    return false;
  }
public static boolean isExactPrimitiveWideningConversion(@NotNull PsiType type, @NotNull PsiType patternType)