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
@@ -396,7 +396,7 @@ public class PackageGenTest extends CodegenTestCase {
}
public void testArraySize() throws Exception {
loadText("fun foo(a: Array<Int>) = a.size");
loadText("fun foo(a: Array<Int>) = a.size()");
Method main = generateFunction();
Object[] args = new Object[] { new Integer[4] };
int result = (Integer) main.invoke(null, args);
@@ -404,7 +404,7 @@ public class PackageGenTest extends CodegenTestCase {
}
public void testIntArraySize() throws Exception {
loadText("fun foo(a: IntArray) = a.size");
loadText("fun foo(a: IntArray) = a.size()");
Method main = generateFunction();
Object[] args = new Object[] { new int[4] };
int result = (Integer) main.invoke(null, args);