I have the following code in Java:
public static void main(String[] args) {
checkVarargs(null);
}
public static void checkVarargs(String... o) {
System.out.println(o);
}
When I try to auto-convert the main method to Kotlin I get the following:
@JvmStatic
fun main(args: Array<String>) {
checkVarargs(null)
}
However, In the Java case a null array is passed, and it prints null while on Kotlin case it prints [Ljava.lang.String;@548c4f57 (array that contains null).
Is it possible to pass null array to Java varargs from Kotlin code?
null.