Make Array.size() a function instead of a property

Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
This commit is contained in:
Alexander Udalov
2014-11-14 18:02:04 +03:00
parent bc238d5f4c
commit 128c938965
67 changed files with 677 additions and 625 deletions
+28
View File
@@ -51,3 +51,31 @@ public fun <T> Iterable<T>.containsItem(item : T) : Boolean = contains(item)
deprecated("Use sortBy() instead")
public fun <T> Iterable<T>.sort(comparator: java.util.Comparator<T>) : List<T> = sortBy(comparator)
deprecated("Use size() instead")
public val Array<*>.size: Int get() = size()
deprecated("Use size() instead")
public val ByteArray.size: Int get() = size()
deprecated("Use size() instead")
public val CharArray.size: Int get() = size()
deprecated("Use size() instead")
public val ShortArray.size: Int get() = size()
deprecated("Use size() instead")
public val IntArray.size: Int get() = size()
deprecated("Use size() instead")
public val LongArray.size: Int get() = size()
deprecated("Use size() instead")
public val FloatArray.size: Int get() = size()
deprecated("Use size() instead")
public val DoubleArray.size: Int get() = size()
deprecated("Use size() instead")
public val BooleanArray.size: Int get() = size()