https://kotlinlang.org logo
#announcements
Title
# announcements
n

nevinchen

10/31/2015, 12:13 AM
anyone having issues about getting size of a ArrayList<T>? I can’t compile below code with Error:
Cannot access 'size': it is 'private' in ‘ArrayList'
Copy code
var list = ArrayList<User>()
var s = list.size
but when I use below , it does compile but the IDE complains with :
Expression ‘size’ of  ‘<http://Kotlin.Int|Kotlin.Int>’ cannot be invoke as a function
Copy code
var list = ArrayList<User>()
var s = list.size ()
I’m on Android Studio 1.5 Preview 2 , Kotlin plugin 1.0.0-beta-1038-ij141-17
2 Views