Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-5
-
Fix Version/s: 1.0-beta-8
-
Component/s: class generator
-
Labels:None
-
Environment:xp and latest CVS
-
Number of attachments :
Description
Object[] ss = new Object[]
{'hello'}Object[] is = new Object[]
{new Integer(1)}println ss.length
// this returns a MethodClosure instead of 1
println is.length
// runtime error: no such property length on Integer
"length" should simply return the length of the array. The first case treats length as a MethodClosure and the second as a property (the property thing hit back again
)
James mentioned that one could work around this by using the generic size() on collections:
s1 = new Object[]
{ 1, 2, 3 }.size()
s2 = "hello".size()
s3 = [1, 2, 3, 4].size()