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
@@ -48,7 +48,7 @@ fun <T> foreignKotlinClass(jClass: Class<T>): KClassImpl<T> {
// This is the most unlikely case: we found a cached array of references of length at least 2 (can't be 1 because
// the single element would be cached instead), and none of those classes is the one we're looking for
val size = cached.size
val size = cached.size()
// Don't use Array constructor because it creates a lambda
val newArray = arrayOfNulls<WeakReference<KClassImpl<*>>>(size + 1)
// Don't use Arrays.copyOf because it works reflectively