Permalink
Browse files

Working around the VerifyErrors.

Since the optimizer seems to have lost its mind.
  • Loading branch information...
paulp committed May 5, 2012
1 parent 6ed849e commit d003dee59cf592879804540a971dab3d8136e480
Showing with 6 additions and 2 deletions.
  1. +1 −1 src/library/scala/Predef.scala
  2. +5 −1 src/library/scala/runtime/SeqCharSequence.scala
@@ -311,7 +311,7 @@ object Predef extends LowPriorityImplicits {
implicit def tuple2ToZippedOps[T1, T2](x: (T1, T2)) = new runtime.Tuple2Zipped.Ops(x)
implicit def tuple3ToZippedOps[T1, T2, T3](x: (T1, T2, T3)) = new runtime.Tuple3Zipped.Ops(x)
implicit def seqToCharSequence(xs: collection.IndexedSeq[Char]): CharSequence = new runtime.SeqCharSequence(xs)
- implicit def arrayToCharSequence(xs: Array[Char]): CharSequence = new runtime.ArrayCharSequence(xs)
+ implicit def arrayToCharSequence(xs: Array[Char]): CharSequence = new runtime.ArrayCharSequence(xs, 0, xs.length)
implicit def genericArrayOps[T](xs: Array[T]): ArrayOps[T] = (xs match {
case x: Array[AnyRef] => refArrayOps[AnyRef](x)
@@ -18,7 +18,11 @@ final class SeqCharSequence(val xs: collection.IndexedSeq[Char]) extends CharSeq
}
final class ArrayCharSequence(val xs: Array[Char], start: Int, end: Int) extends CharSequence {
- def this(xs: Array[Char]) = this(xs, 0, xs.length)
+ // yikes
+ // java.lang.VerifyError: (class: scala/runtime/ArrayCharSequence, method: <init> signature: ([C)V)
+ // Constructor must call super() or this()
+ //
+ // def this(xs: Array[Char]) = this(xs, 0, xs.length)
def length: Int = math.max(0, end - start)
def charAt(index: Int): Char = {

0 comments on commit d003dee

Please sign in to comment.