Skip to content

Commit 5d96905

Browse files
committed
Remove ambiguous implicit buildableSeq
1 parent 3769e1d commit 5d96905

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

jvm/src/test/scala/org/scalacheck/GenSpecification.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ object GenSpecification extends Properties("Gen") with GenSpecificationVersionSp
4343
(noneFailing(l) && forAll(sequence[List[Int],Int](l)) { _.length == l.length })
4444
)
4545

46+
property("sequence.map(_.mkString)") = {
47+
import scala.collection.JavaConverters._
48+
val listOfGens: List[Gen[Char]] = "".toList.map(Gen.const(_))
49+
val g1: Gen[String] = Gen.sequence(listOfGens).map(_.asScala.mkString)
50+
val g2: Gen[String] = Gen.sequence(List(Gen.listOf(' ').map(_.mkString))).map(_.asScala.mkString)
51+
forAll(g1, g2) { (s1, s2) =>
52+
true
53+
}
54+
}
55+
4656
property("frequency 1") = {
4757
val g = frequency((10, const(0)), (5, const(1)))
4858
forAll(g) { n => true }

src/main/scala/org/scalacheck/util/Buildable.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,4 @@ object Buildable extends BuildableVersionSpecific {
2626
new Buildable[T, ArrayList[T]] {
2727
def builder = new ArrayListBuilder[T]
2828
}
29-
30-
implicit def buildableSeq[T]: Buildable[T, Seq[T]] =
31-
new Buildable[T, Seq[T]] {
32-
def builder: mutable.Builder[T, Seq[T]] =
33-
Seq.newBuilder[T]
34-
}
3529
}

0 commit comments

Comments
 (0)