diff options
Diffstat (limited to 'tests/run/t6633.scala')
-rw-r--r-- | tests/run/t6633.scala | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/run/t6633.scala b/tests/run/t6633.scala new file mode 100644 index 000000000..852fc5714 --- /dev/null +++ b/tests/run/t6633.scala @@ -0,0 +1,33 @@ +object Test extends dotty.runtime.LegacyApp { + import collection.mutable.ListBuffer + + def newLB = ListBuffer('a, 'b, 'c, 'd, 'e) + + val lb0 = newLB + + try { + lb0.insert(9, 'x) + } catch { + case ex: IndexOutOfBoundsException => println(ex) + } + + val lb1 = newLB + + try { + lb1.insert(9, 'x) + } catch { + case ex: IndexOutOfBoundsException => + } + + val replStr = scala.runtime.ScalaRunTime.replStringOf(lb1, 100) + if (replStr == "ListBuffer('a, 'b, 'c, 'd, 'e)\n") + println("replStringOf OK") + else + println("replStringOf FAILED: " + replStr) + + val len = lb1.length + if (len == 5) + println("length OK") + else + println("length FAILED: " + len) +} |