Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.6
-
Fix Version/s: 0.7
-
Component/s: Runtime (Boo.Lang)
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
runtimeservices.getslice can't handle simple slicing of arrays or lists (when there is no defaultmember attribute).
o as object //or duck if not in -ducky mode
o = [1, 2, 3]
print o[2]
o = (4, 5, 6)
print o[2]
The patch isn't pretty because of tortoisesvn, but one way to fix this is to add this to getslice:
if (target is IList && args.Length == 1 && args[0] is int)
This version of the patch adds index normalization:
x as duck
x = (1,2,3)
print x[-1]