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:
@@ -4,12 +4,9 @@ import java.util.HashSet
|
||||
|
||||
fun iarray(vararg a : Int) = a // BUG
|
||||
|
||||
fun IntArray.lastIndex() = size - 1
|
||||
fun IntArray.lastIndex() = size() - 1
|
||||
|
||||
fun box() : String {
|
||||
// Problematic code does not compile
|
||||
// val vals = iarray(789, 678, 567, 456, 345, 234, 123, 012)
|
||||
|
||||
val vals = iarray(789, 678, 567, 456, 345, 234, 123, 12)
|
||||
val diffs = HashSet<Int>()
|
||||
for (i in vals.indices)
|
||||
|
||||
Reference in New Issue
Block a user