Aladdin - Scala Bugtracking
[#1128] project: api priority: low category: bug
submitter assigned to status date submitted
Nikolay Sean fixed 2007-05-21 21:06:04.0
subject [contrib #515] RandomAccessSeq.Projection +++ bug
code
===
val a = Array(1, 2)
val b = Array(3, 4)

val p = a.projection +++ b.projection

Console.println(p)
===

throws java.lang.ArrayIndexOutOfBoundsException: 2

===
Index: RandomAccessSeq.scala
===================================================================
--- RandomAccessSeq.scala       (revision 11112)
+++ RandomAccessSeq.scala       (working copy)
@@ -54,6 +54,6 @@
     def length = RandomAccessSeq.this.length + that.length
     def apply(idx : Int) = 
       if (idx < RandomAccessSeq.this.length) RandomAccessSeq.this(idx)
-      else that(idx)
+      else that(idx - RandomAccessSeq.this.length)
   }
 }
\ No newline at end of file
===

scala is 2.5.0.11112.20070521-181209
what happened
what expected
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-05-21 21:07:23.0
Sean  edited on  2007-07-17 17:59:01.0
patch consumed.