boolean (@NotNull PsiType exprType, @NotNull PsiType parameterType, @NotNull final PsiElement context) { if (exprType instanceof PsiClassType && parameterType instanceof PsiPrimitiveType) { parameterType = ((PsiPrimitiveType)parameterType).getBoxedType(context); //unboxing from type of cast expression will take place at runtime if (parameterType == null) return false; } if (exprType instanceof PsiPrimitiveType && parameterType instanceof PsiClassType) { if (PsiTypes.nullType().equals(exprType)) { return true; } parameterType = PsiPrimitiveType.getUnboxedType(parameterType); if (parameterType == null) return false; } if (parameterType.isConvertibleFrom(exprType)) { return true; } return parameterType instanceof PsiEllipsisType && areTypesConvertible(exprType, ((PsiEllipsisType)parameterType).getComponentType(), context); }