Skip to content

Commit f34bfcd

Browse files
committed
prepare for Dotty: put explicit types on implicit defs
1 parent d93c30e commit f34bfcd

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ self =>
296296
}
297297

298298
/* convenience task operations wrapper */
299-
protected implicit def task2ops[R, Tp](tsk: SSCTask[R, Tp]) = new TaskOps[R, Tp] {
299+
protected implicit def task2ops[R, Tp](tsk: SSCTask[R, Tp]): TaskOps[R, Tp] = new TaskOps[R, Tp] {
300300
def mapResult[R1](mapping: R => R1): ResultMapping[R, Tp, R1] = new ResultMapping[R, Tp, R1](tsk) {
301301
def map(r: R): R1 = mapping(r)
302302
}
@@ -316,14 +316,14 @@ self =>
316316
}
317317

318318
/* convenience signalling operations wrapper */
319-
protected implicit def delegatedSignalling2ops[PI <: DelegatedSignalling](it: PI) = new SignallingOps[PI] {
319+
protected implicit def delegatedSignalling2ops[PI <: DelegatedSignalling](it: PI): SignallingOps[PI] = new SignallingOps[PI] {
320320
def assign(cntx: Signalling): PI = {
321321
it.signalDelegate = cntx
322322
it
323323
}
324324
}
325325

326-
protected implicit def builder2ops[Elem, To](cb: Builder[Elem, To]) = new BuilderOps[Elem, To] {
326+
protected implicit def builder2ops[Elem, To](cb: Builder[Elem, To]): BuilderOps[Elem, To] = new BuilderOps[Elem, To] {
327327
def ifIs[Cmb](isbody: Cmb => Unit) = new Otherwise[Cmb] {
328328
def otherwise(notbody: => Unit)(implicit t: ClassTag[Cmb]): Unit = {
329329
if (cb.getClass == t.runtimeClass) isbody(cb.asInstanceOf[Cmb]) else notbody

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ package object parallel {
6666
package parallel {
6767
/** Implicit conversions used in the implementation of parallel collections. */
6868
private[collection] object ParallelCollectionImplicits {
69-
implicit def traversable2ops[T](t: scala.collection.IterableOnce[T]) = new TraversableOps[T] {
69+
implicit def traversable2ops[T](t: scala.collection.IterableOnce[T]): TraversableOps[T] = new TraversableOps[T] {
7070
def isParallel = t.isInstanceOf[Parallel]
7171
def isParIterable = t.isInstanceOf[ParIterable[_]]
7272
def asParIterable = t.asInstanceOf[ParIterable[T]]

junit/src/test/scala/scala/collection/concurrent/ctries_new/Spec.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ import scala.reflect.{ClassTag, classTag}
1616

1717
trait Spec {
1818

19-
implicit def implicitously = scala.language.implicitConversions
20-
implicit def reflectively = scala.language.reflectiveCalls
21-
22-
implicit def str2ops(s: String) = new {
19+
implicit class Str2ops(s: String) {
2320
def in[U](body: =>U): Unit = {
2421
// just execute body
2522
body
2623
}
2724
}
2825

29-
implicit def any2ops(a: Any) = new {
26+
implicit class Any2ops(a: Any) {
3027
def shouldEqual(other: Any) = assert(a == other)
3128
}
3229

junit/src/test/scala/scala/collection/concurrent/ctries_old/Spec.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@
1212

1313
package scala.collection.concurrent.ctries_old
1414

15-
import scala.reflect.ClassTag
15+
import scala.reflect.{ClassTag, classTag}
1616

1717
trait Spec {
1818

19-
implicit def implicitously = scala.language.implicitConversions
20-
implicit def reflectively = scala.language.reflectiveCalls
21-
22-
implicit def str2ops(s: String) = new {
19+
implicit class Str2ops(s: String) {
2320
def in[U](body: =>U): Unit = {
2421
// just execute body
2522
body
2623
}
2724
}
2825

29-
implicit def any2ops(a: Any) = new {
26+
implicit class Any2ops(a: Any) {
3027
def shouldEqual(other: Any) = assert(a == other)
3128
}
3229

0 commit comments

Comments
 (0)