Multi-dimensonal arrays are a pain point in Kotlin


I love so much about Kotlin, but I have found one area where Java is actually friendlier to work with: mutli-dimensional arrays.

Not just in terms of verbosity, but I Think the readability is better in Java.


int[][] points = new int[10][10];

val points = Array<Array<Int>>()

at two dimensionals it is managable, but at three or four I think it would be quite ugly.

Or is it possible I have missed a better way to do this?


Could you share your use cases


The simplest use case is a 2d array to represent a grid for a tile based game.

It is not a big deal, but everything else about Kotlin is so nice this jumps out at me.


Ok, thanks


Have you considered adding Ceylon style type aliases? Would solve this problem.


Yes, we are planning to support something like this