@@ -14,14 +14,13 @@ package scala.collection.compat
14
14
15
15
import scala .reflect .ClassTag
16
16
import scala .collection .generic .CanBuildFrom
17
- import scala .collection .mutable .Builder
18
17
import scala .collection .{immutable => i , mutable => m }
19
18
20
19
/* builder optimized for a single ++= call, which returns identity on result if possible
21
20
* and defers to the underlying builder if not.
22
21
*/
23
- private final class IdentityPreservingBuilder [A , CC [X ] <: TraversableOnce [X ]](that : Builder [A , CC [A ]])(implicit ct : ClassTag [CC [A ]])
24
- extends Builder [A , CC [A ]] {
22
+ private final class IdentityPreservingBuilder [A , CC [X ] <: TraversableOnce [X ]](that : m. Builder [A , CC [A ]])(implicit ct : ClassTag [CC [A ]])
23
+ extends m. Builder [A , CC [A ]] {
25
24
26
25
// invariant: ruined => (collection == null)
27
26
var collection : CC [A ] = null .asInstanceOf [CC [A ]]
@@ -62,9 +61,9 @@ private final class IdentityPreservingBuilder[A, CC[X] <: TraversableOnce[X]](th
62
61
}
63
62
64
63
private [compat] object CompatImpl {
65
- def simpleCBF [A , C ](f : => Builder [A , C ]): CanBuildFrom [Any , A , C ] = new CanBuildFrom [Any , A , C ] {
66
- def apply (from : Any ): Builder [A , C ] = apply()
67
- def apply (): Builder [A , C ] = f
64
+ def simpleCBF [A , C ](f : => m. Builder [A , C ]): CanBuildFrom [Any , A , C ] = new CanBuildFrom [Any , A , C ] {
65
+ def apply (from : Any ): m. Builder [A , C ] = apply()
66
+ def apply (): m. Builder [A , C ] = f
68
67
}
69
68
70
69
type ImmutableBitSetCC [X ] = ({ type L [_] = i.BitSet })# L [X ]
0 commit comments