Skip to content

Commit 0d14e71

Browse files
committed
Restrict generic seqStream and parStream to AnyRef element types
1 parent 8ca53f0 commit 0d14e71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/scala/compat/java8/StreamConverters.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait PrimitiveStreamUnboxer[A, S] {
1616

1717
trait Priority5StreamConverters {
1818
// Note--conversion is only to make sure implicit conversion priority is lower than alternatives.
19-
implicit class EnrichScalaCollectionWithSeqStream[A, CC](cc: CC)(implicit steppize: CC => MakesAnySeqStepper[A])
19+
implicit class EnrichScalaCollectionWithSeqStream[A <: AnyRef, CC](cc: CC)(implicit steppize: CC => MakesAnySeqStepper[A])
2020
extends MakesSequentialStream[A, Stream[A]] {
2121
def seqStream: Stream[A] = StreamSupport.stream(steppize(cc).stepper, false)
2222
}
@@ -62,7 +62,7 @@ trait Priority4StreamConverters extends Priority5StreamConverters {
6262
}
6363

6464
trait Priority3StreamConverters extends Priority4StreamConverters {
65-
implicit class EnrichAnySteppableWithStream[A, CC](cc: CC)(implicit steppize: CC => MakesAnyStepper[A])
65+
implicit class EnrichAnySteppableWithStream[A <: AnyRef, CC](cc: CC)(implicit steppize: CC => MakesAnyStepper[A])
6666
extends MakesSequentialStream[A, Stream[A]] with MakesParallelStream[A, Stream[A]] {
6767
def seqStream: Stream[A] = StreamSupport.stream(steppize(cc).stepper, false)
6868
def parStream: Stream[A] = StreamSupport.stream(steppize(cc).stepper.anticipateParallelism, true)

0 commit comments

Comments
 (0)