File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
core/src/main/scala/scala/collection/parallel
junit/src/test/scala/scala/collection/parallel/mutable Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -471,6 +471,8 @@ extends IterableOnce[T @uncheckedVariance]
471471 }
472472
473473 def max [U >: T ](implicit ord : Ordering [U ]): T = {
474+ if (isEmpty) throw new UnsupportedOperationException (" empty.max" )
475+
474476 tasksupport.executeAndWaitResult(new Max (ord, splitter)).get.asInstanceOf [T ]
475477 }
476478
Original file line number Diff line number Diff line change @@ -138,4 +138,9 @@ class ParArrayTest extends scala.collection.concurrent.ctries_old.Spec {
138138 evaluating { ParArray .empty[Int ].min }.shouldProduce[UnsupportedOperationException ]()
139139 }
140140
141+ @ Test
142+ def `empty max` : Unit = {
143+ evaluating { ParArray .empty[Int ].max }.shouldProduce[UnsupportedOperationException ]()
144+ }
145+
141146}
You can’t perform that action at this time.
0 commit comments