Make Array<T>(size, init) a constructor of Array

It's not marked as inline, this is why 'crossinline' was added in
jaggedArray.kt/jaggedDeep.kt. Will be fixed in the following commits
This commit is contained in:
Alexander Udalov
2016-01-21 22:22:00 +03:00
parent 18238bd6f3
commit 04026dbe84
15 changed files with 123 additions and 380 deletions
+3 -1
View File
@@ -22,8 +22,10 @@ package kotlin
* standard library functions.
* See [Kotlin language documentation](http://kotlinlang.org/docs/reference/basic-types.html#arrays)
* for more information on arrays.
* @constructor Creates a new array with the specified [size], where each element is calculated by calling the specified
* [init] function. The [init] function returns an array element given its index.
*/
public class Array<T> private (): Cloneable {
public class Array<T>(size: Int, init: (Int) -> T): Cloneable {
/**
* Returns the array element at the specified [index]. This method can be called using the
* index operator: