Skip to content

Commit 6d01d5a

Browse files
authored
Merge pull request #148 from lrytz/2.13-rc3
Adapt to 2.13.0-RC3
2 parents 29f2b2b + 4b8d41a commit 6d01d5a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jdk:
77
- openjdk11
88

99
scala:
10-
- 2.13.0-RC2
10+
- 2.13.0-RC3
1111

1212
env:
1313
global:

Diff for: build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ScalaModulePlugin._
22

3-
crossScalaVersions in ThisBuild := List("2.13.0-RC2")
3+
crossScalaVersions in ThisBuild := List("2.13.0-RC3")
44

55
val disableDocs =
66
sys.props("nodocs") == "true" ||

Diff for: src/main/java/scala/compat/java8/ScalaStreamSupport.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static <K> Stream<K> streamKeys(Map<K, ?> coll) {
7171
* @return A Stream view of the collection which, by default, executes sequentially.
7272
*/
7373
public static <V> Stream<V> streamValues(Map<?, V> coll) {
74-
return StreamSupport.stream(coll.<V, AnyStepper<V>>valueStepper(StepperShape.anyStepperShape()).spliterator(), false);
74+
return StreamSupport.stream(coll.<AnyStepper<V>>valueStepper(StepperShape.anyStepperShape()).spliterator(), false);
7575
}
7676

7777
/**

Diff for: src/main/scala/scala/compat/java8/StreamConverters.scala

+13-13
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ trait StreamExtensions {
4141
s.fromStepper(cc.stepper, par = false)
4242
}
4343

44-
protected type IterableOnceWithEfficientStepper[A] = IterableOnce[A] {
45-
def stepper[B >: A, S <: Stepper[_]](implicit shape : StepperShape[B, S]) : S with EfficientSplit
46-
}
47-
4844
// Not `CC[X] <: IterableOnce[X]`, but `C` with an extra constraint, to support non-parametric classes like IntAccumulator
4945
implicit class IterableNonGenericHasParStream[A, C <: IterableOnce[_]](c: C)(implicit ev: C <:< IterableOnce[A]) {
46+
private type IterableOnceWithEfficientStepper = IterableOnce[A] {
47+
def stepper[S <: Stepper[_]](implicit shape : StepperShape[A, S]) : S with EfficientSplit
48+
}
49+
5050
/** Create a parallel [[java.util.stream.Stream Java Stream]] for this collection. If the
5151
* collection contains primitive values, a corresponding specialized Stream is returned (e.g.,
5252
* [[java.util.stream.IntStream `IntStream`]]).
@@ -55,13 +55,13 @@ trait StreamExtensions {
5555
s: StreamShape[A, S, St],
5656
st: StepperShape[A, St],
5757
@implicitNotFound("`parStream` can only be called on collections where `stepper` returns a `Stepper with EfficientSplit`")
58-
isEfficient: C <:< IterableOnceWithEfficientStepper[A]): S =
58+
isEfficient: C <:< IterableOnceWithEfficientStepper): S =
5959
s.fromStepper(ev(c).stepper, par = true)
6060
}
6161

6262
// maps
6363

64-
implicit class MapHasSeqKeyValueStream[K, V, CC[X, Y] <: collection.MapOps[X, Y, CC, _]](cc: CC[K, V]) {
64+
implicit class MapHasSeqKeyValueStream[K, V, CC[X, Y] <: collection.MapOps[X, Y, collection.Map, _]](cc: CC[K, V]) {
6565
/** Create a sequential [[java.util.stream.Stream Java Stream]] for the keys of this map. If
6666
* the keys are primitive values, a corresponding specialized Stream is returned (e.g.,
6767
* [[java.util.stream.IntStream `IntStream`]]).
@@ -85,10 +85,10 @@ trait StreamExtensions {
8585
}
8686

8787

88-
implicit class MapHasParKeyValueStream[K, V, CC[X, Y] <: collection.MapOps[X, Y, CC, _]](cc: CC[K, V]) {
89-
private type MapOpsWithEfficientKeyStepper[K, V] = collection.MapOps[K, V, CC, _] { def keyStepper[S <: Stepper[_]](implicit shape : StepperShape[K, S]) : S with EfficientSplit }
90-
private type MapOpsWithEfficientValueStepper[K, V] = collection.MapOps[K, V, CC, _] { def valueStepper[V1 >: V, S <: Stepper[_]](implicit shape : StepperShape[V1, S]) : S with EfficientSplit }
91-
private type MapOpsWithEfficientStepper[K, V] = collection.MapOps[K, V, CC, _] { def stepper[B >: (K, V), S <: Stepper[_]](implicit shape : StepperShape[B, S]) : S with EfficientSplit }
88+
implicit class MapHasParKeyValueStream[K, V, CC[X, Y] <: collection.MapOps[X, Y, collection.Map, _]](cc: CC[K, V]) {
89+
private type MapOpsWithEfficientKeyStepper = collection.MapOps[K, V, collection.Map, _] { def keyStepper[S <: Stepper[_]](implicit shape : StepperShape[K, S]) : S with EfficientSplit }
90+
private type MapOpsWithEfficientValueStepper = collection.MapOps[K, V, collection.Map, _] { def valueStepper[V1 >: V, S <: Stepper[_]](implicit shape : StepperShape[V1, S]) : S with EfficientSplit }
91+
private type MapOpsWithEfficientStepper = collection.MapOps[K, V, collection.Map, _] { def stepper[S <: Stepper[_]](implicit shape : StepperShape[(K, V), S]) : S with EfficientSplit }
9292

9393
/** Create a parallel [[java.util.stream.Stream Java Stream]] for the keys of this map. If
9494
* the keys are primitive values, a corresponding specialized Stream is returned (e.g.,
@@ -98,7 +98,7 @@ trait StreamExtensions {
9898
s: StreamShape[K, S, St],
9999
st: StepperShape[K, St],
100100
@implicitNotFound("parKeyStream can only be called on maps where `keyStepper` returns a `Stepper with EfficientSplit`")
101-
isEfficient: CC[K, V] <:< MapOpsWithEfficientKeyStepper[K, V]): S =
101+
isEfficient: CC[K, V] <:< MapOpsWithEfficientKeyStepper): S =
102102
s.fromStepper(cc.keyStepper, par = true)
103103

104104
/** Create a parallel [[java.util.stream.Stream Java Stream]] for the values of this map. If
@@ -109,7 +109,7 @@ trait StreamExtensions {
109109
s: StreamShape[V, S, St],
110110
st: StepperShape[V, St],
111111
@implicitNotFound("parValueStream can only be called on maps where `valueStepper` returns a `Stepper with EfficientSplit`")
112-
isEfficient: CC[K, V] <:< MapOpsWithEfficientValueStepper[K, V]): S =
112+
isEfficient: CC[K, V] <:< MapOpsWithEfficientValueStepper): S =
113113
s.fromStepper(cc.valueStepper, par = true)
114114

115115
// The parStream extension method for IterableOnce doesn't apply because its `CC` takes a single type parameter, whereas the one here takes two
@@ -120,7 +120,7 @@ trait StreamExtensions {
120120
s: StreamShape[(K, V), S, St],
121121
st: StepperShape[(K, V), St],
122122
@implicitNotFound("parStream can only be called on maps where `stepper` returns a `Stepper with EfficientSplit`")
123-
isEfficient: CC[K, V] <:< MapOpsWithEfficientStepper[K, V]): S =
123+
isEfficient: CC[K, V] <:< MapOpsWithEfficientStepper): S =
124124
s.fromStepper(cc.stepper, par = true)
125125
}
126126

0 commit comments

Comments
 (0)