Skip to content

Commit 58607c1

Browse files
committed
Fix colltest4: ListBuffer[A]#fromIterable had an incorrect cast
1 parent 82df744 commit 58607c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/strawman/collections/CollectionStrawMan4.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ object CollectionStrawMan4 {
218218
def fromIterable[B](coll: Iterable[B]): ListBuffer[B] = coll match {
219219
case pd @ View.Partitioned(partition: View.Partition[B]) =>
220220
partition.distribute(new ListBuffer[B]())
221-
pd.forced.get.asInstanceOf[ListBuffer[B]]
221+
new ListBuffer[B] ++= pd.forced.get
222222
case _ =>
223223
new ListBuffer[B] ++= coll
224224
}

tests/run/colltest4/CollectionStrawMan4_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ object CollectionStrawMan4 {
217217
def fromIterable[B](coll: Iterable[B]): ListBuffer[B] = coll match {
218218
case pd @ View.Partitioned(partition: View.Partition[B]) =>
219219
partition.distribute(new ListBuffer[B]())
220-
pd.forced.get.asInstanceOf[ListBuffer[B]]
220+
new ListBuffer[B] ++= pd.forced.get
221221
case _ =>
222222
new ListBuffer[B] ++= coll
223223
}

0 commit comments

Comments
 (0)