Skip to content

Commit 04f028b

Browse files
authored
Merge pull request #161 from lrytz/t152
2 parents bc48630 + df6ff3c commit 04f028b

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import: scala/scala-dev:travis/default.yml
55
language: scala
66

77
scala:
8-
- 2.13.4
98
- 3.0.0-M3
109
- 3.0.0-RC1
10+
- 2.13.4
1111

1212
env:
1313
- ADOPTOPENJDK=8

core/src/main/scala/scala/collection/parallel/ParIterableLike.scala

+10-2
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,11 @@ extends IterableOnce[T @uncheckedVariance]
550550
def apply() = shared
551551
def doesShareCombiners = true
552552
} else new CombinerFactory[T, Repr] {
553-
def apply() = newCombiner
553+
def apply() = {
554+
val r = newCombiner
555+
r.combinerTaskSupport = tasksupport
556+
r
557+
}
554558
def doesShareCombiners = false
555559
}
556560
}
@@ -563,7 +567,11 @@ extends IterableOnce[T @uncheckedVariance]
563567
def apply() = shared
564568
def doesShareCombiners = true
565569
} else new CombinerFactory[S, That] {
566-
def apply() = cbf()
570+
def apply() = {
571+
val r = cbf()
572+
r.combinerTaskSupport = tasksupport
573+
r
574+
}
567575
def doesShareCombiners = false
568576
}
569577
}

junit/src/test/scala/scala/collection/parallel/TaskTest.scala

+9
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,13 @@ class TaskTest {
3939

4040
for (x <- one ; y <- two) assertEquals("two", Thread.currentThread.getName)
4141
}
42+
43+
@Test
44+
def `t152 pass on task support`(): Unit = {
45+
val myTs = new ExecutionContextTaskSupport()
46+
val c = List(1).par
47+
c.tasksupport = myTs
48+
val r = c.filter(_ != 0).map(_ + 1)
49+
assertSame(myTs, r.tasksupport)
50+
}
4251
}

0 commit comments

Comments
 (0)