I tried this, and the code didn\'t compile.
class GenericClass() { private var arr : Array? = null { arr = Array(10,
You could use a helper function as below:
@Suppress("UNCHECKED_CAST") fun genericArrayOfNulls(size: Int): Array { return arrayOfNulls(size) as Array }