Q:

Coding style: function call with typed null

E.g. the Java class java.awt.image.Raster has multiple overloaded methods, like
double[] getPixel(int x, int y, double[] dArray)
float[] getPixel(int x, int y, float[] fArray)
int[] getPixel(int x, int y, int[] iArray)

It is allowed to call the method with null as array but how to do it right in Kotlin?
val pixel = raster.getPixel(1, 2, null)

fails because of an ambiguity and
val pixel = raster.getPixel(1, 2, null as IntArray)

gives a warning that "This cast can never succeed".
Is there a way to call the function so that it completely pleases the compiler?

A:

"this cast can never succeed" is referring to the fact that IntArray is not a nullable type, and so trying to cast null to IntArray will always fail.
Since java reference types can always be null, I would expect kotlin to treat that int[] as an IntArray? (at least, in the absence of a @Nonnull annotation), and so null as IntArray? is what you want.
e.g.
val pixel = raster.getPixel(1, 2, null as IntArray?)

