Problem
CLR arrays (array[T]) don't support Python-style negative indexing. arr[-1] throws IndexOutOfRangeException instead of returning the last element.
Sharpy lists handle this via wrapper methods in Sharpy.Core, but CLR arrays use native .NET array indexing which doesn't have this support.
Reproduction
def main():
arr: array[int] = array[int](3)
arr[0] = 10
arr[1] = 20
arr[2] = 30
print(arr[-1]) # should print 30
print(arr[-2]) # should print 20
Expected output:
Actual: IndexOutOfRangeException at runtime.
Possible Approach
Add a Sharpy.Core wrapper or extension method for array indexing that normalizes negative indices.
Skipped Test
TestFixtures/arrays/array_negative_index.spy — skip reason: "CLR arrays don't support negative indexing natively; needs Sharpy.Core wrapper"
Problem
CLR arrays (
array[T]) don't support Python-style negative indexing.arr[-1]throwsIndexOutOfRangeExceptioninstead of returning the last element.Sharpy lists handle this via wrapper methods in Sharpy.Core, but CLR arrays use native .NET array indexing which doesn't have this support.
Reproduction
Expected output:
Actual:
IndexOutOfRangeExceptionat runtime.Possible Approach
Add a Sharpy.Core wrapper or extension method for array indexing that normalizes negative indices.
Skipped Test
TestFixtures/arrays/array_negative_index.spy— skip reason: "CLR arrays don't support negative indexing natively; needs Sharpy.Core wrapper"