Implemented workaround for SI-4789, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25266 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
88879a9d4a
commit
3190280d30
|
@ -38,9 +38,11 @@ abstract class GenTraversableFactory[CC[X] <: GenTraversable[X] with GenericTrav
|
||||||
|
|
||||||
// A default implementation of GenericCanBuildFrom which can be cast
|
// A default implementation of GenericCanBuildFrom which can be cast
|
||||||
// to whatever is desired.
|
// to whatever is desired.
|
||||||
private[collection] object ReusableCBF extends GenericCanBuildFrom[Nothing] {
|
private class ReusableCBF extends GenericCanBuildFrom[Nothing] {
|
||||||
override def apply() = newBuilder[Nothing]
|
override def apply() = newBuilder[Nothing]
|
||||||
}
|
}
|
||||||
|
// Working around SI-4789 by using a lazy val instead of an object.
|
||||||
|
lazy val ReusableCBF: GenericCanBuildFrom[Nothing] = new ReusableCBF
|
||||||
|
|
||||||
/** A generic implementation of the `CanBuildFrom` trait, which forwards
|
/** A generic implementation of the `CanBuildFrom` trait, which forwards
|
||||||
* all calls to `apply(from)` to the `genericBuilder` method of
|
* all calls to `apply(from)` to the `genericBuilder` method of
|
||||||
|
|
Loading…
Reference in New Issue