Skip to content

Commit 8f50b71

Browse files
nicolasstuckicheeseng
authored andcommitted
Remove implicit conversions to Predef.any2stringadd
1 parent 88c9cf6 commit 8f50b71

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

scalactic-test/src/test/scala/org/scalactic/ChainSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,8 +1024,8 @@ class ChainSpec extends UnitSpec {
10241024
it should "have a scan method" in {
10251025
Chain(1).scan(0)(_ + _) shouldBe Chain(0, 1)
10261026
Chain(1, 2, 3).scan(0)(_ + _) shouldBe Chain(0, 1, 3, 6)
1027-
Chain(1, 2, 3).scan("z")(_ + _.toString) shouldBe Chain("z", "z1", "z12", "z123")
1028-
Chain(0).scan("z")(_ + _.toString) shouldBe Chain("z", "z0")
1027+
Chain(1, 2, 3).scan("z")(_.toString + _.toString) shouldBe Chain("z", "z1", "z12", "z123")
1028+
Chain(0).scan("z")(_.toString + _.toString) shouldBe Chain("z", "z0")
10291029
}
10301030
it should "have a scanLeft method" in {
10311031
Chain(1).scanLeft(0)(_ + _) shouldBe Chain(0, 1)

scalactic-test/src/test/scala/org/scalactic/EverySpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,8 @@ class EverySpec extends UnitSpec {
824824
it should "have a scan method" in {
825825
Every(1).scan(0)(_ + _) shouldBe Every(0, 1)
826826
Every(1, 2, 3).scan(0)(_ + _) shouldBe Every(0, 1, 3, 6)
827-
Every(1, 2, 3).scan("z")(_ + _.toString) shouldBe Every("z", "z1", "z12", "z123")
828-
Every(0).scan("z")(_ + _.toString) shouldBe Every("z", "z0")
827+
Every(1, 2, 3).scan("z")(_.toString + _.toString) shouldBe Every("z", "z1", "z12", "z123")
828+
Every(0).scan("z")(_.toString + _.toString) shouldBe Every("z", "z0")
829829
}
830830
it should "have a scanLeft method" in {
831831
Every(1).scanLeft(0)(_ + _) shouldBe Every(0, 1)

scalactic-test/src/test/scala/org/scalactic/anyvals/NonEmptyArraySpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,8 @@ class NonEmptyArraySpec extends UnitSpec {
10431043
it should "have a scan method" in {
10441044
NonEmptyArray(1).scan(0)(_ + _) shouldBe NonEmptyArray(0, 1)
10451045
NonEmptyArray(1, 2, 3).scan(0)(_ + _) shouldBe NonEmptyArray(0, 1, 3, 6)
1046-
NonEmptyArray(1, 2, 3).scan("z")(_ + _.toString) shouldBe NonEmptyArray("z", "z1", "z12", "z123")
1047-
NonEmptyArray(0).scan("z")(_ + _.toString) shouldBe NonEmptyArray("z", "z0")
1046+
NonEmptyArray(1, 2, 3).scan("z")(_.toString + _.toString) shouldBe NonEmptyArray("z", "z1", "z12", "z123")
1047+
NonEmptyArray(0).scan("z")(_.toString + _.toString) shouldBe NonEmptyArray("z", "z0")
10481048
}
10491049
it should "have a scanLeft method" in {
10501050
NonEmptyArray(1).scanLeft(0)(_ + _) shouldBe NonEmptyArray(0, 1)

scalactic-test/src/test/scala/org/scalactic/anyvals/NonEmptyListSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,8 @@ class NonEmptyListSpec extends UnitSpec {
10231023
it should "have a scan method" in {
10241024
NonEmptyList(1).scan(0)(_ + _) shouldBe NonEmptyList(0, 1)
10251025
NonEmptyList(1, 2, 3).scan(0)(_ + _) shouldBe NonEmptyList(0, 1, 3, 6)
1026-
NonEmptyList(1, 2, 3).scan("z")(_ + _.toString) shouldBe NonEmptyList("z", "z1", "z12", "z123")
1027-
NonEmptyList(0).scan("z")(_ + _.toString) shouldBe NonEmptyList("z", "z0")
1026+
NonEmptyList(1, 2, 3).scan("z")(_.toString + _.toString) shouldBe NonEmptyList("z", "z1", "z12", "z123")
1027+
NonEmptyList(0).scan("z")(_.toString + _.toString) shouldBe NonEmptyList("z", "z0")
10281028
}
10291029
it should "have a scanLeft method" in {
10301030
NonEmptyList(1).scanLeft(0)(_ + _) shouldBe NonEmptyList(0, 1)

scalactic-test/src/test/scala/org/scalactic/anyvals/NonEmptySetSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ class NonEmptySetSpec extends UnitSpec {
538538
it should "have a scan method" in {
539539
NonEmptySet(1).scan(0)(_ + _) shouldBe NonEmptySet(0, 1)
540540
NonEmptySet(1, 2, 3).scan(0)(_ + _) shouldBe NonEmptySet(0, 2, 5, 6)
541-
NonEmptySet(1, 2, 3).scan("z")(_ + _.toString) shouldBe NonEmptySet("z", "z2", "z23", "z231")
542-
NonEmptySet(0).scan("z")(_ + _.toString) shouldBe NonEmptySet("z", "z0")
541+
NonEmptySet(1, 2, 3).scan("z")(_.toString + _.toString) shouldBe NonEmptySet("z", "z2", "z23", "z231")
542+
NonEmptySet(0).scan("z")(_.toString + _.toString) shouldBe NonEmptySet("z", "z0")
543543
}
544544
it should "have a scanLeft method" in {
545545
NonEmptySet(1).scanLeft(0)(_ + _) shouldBe NonEmptySet(0, 1)

scalactic-test/src/test/scala/org/scalactic/anyvals/NonEmptyVectorSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,8 @@ class NonEmptyVectorSpec extends UnitSpec {
984984
it should "have a scan method" in {
985985
NonEmptyVector(1).scan(0)(_ + _) shouldBe NonEmptyVector(0, 1)
986986
NonEmptyVector(1, 2, 3).scan(0)(_ + _) shouldBe NonEmptyVector(0, 1, 3, 6)
987-
NonEmptyVector(1, 2, 3).scan("z")(_ + _.toString) shouldBe NonEmptyVector("z", "z1", "z12", "z123")
988-
NonEmptyVector(0).scan("z")(_ + _.toString) shouldBe NonEmptyVector("z", "z0")
987+
NonEmptyVector(1, 2, 3).scan("z")(_.toString + _.toString) shouldBe NonEmptyVector("z", "z1", "z12", "z123")
988+
NonEmptyVector(0).scan("z")(_.toString + _.toString) shouldBe NonEmptyVector("z", "z0")
989989
}
990990
it should "have a scanLeft method" in {
991991
NonEmptyVector(1).scanLeft(0)(_ + _) shouldBe NonEmptyVector(0, 1)

scalactic/src/main/scala/org/scalactic/Differ.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,17 @@ private[scalactic] class GenMapDiffer[K, V] extends Differ {
192192
val leftValue = aMap(k)
193193
val rightValue = bMap(k)
194194
if (leftValue != rightValue)
195-
Some(k + ": " + leftValue + " -> " + rightValue)
195+
Some(k.toString + ": " + leftValue + " -> " + rightValue)
196196
else
197197
None
198198
}.toSet ++
199199
missingKeyInLeft.flatMap { k =>
200200
val rightValue = bMap(k)
201-
Option(k + ": -> " + rightValue)
201+
Option(k.toString + ": -> " + rightValue)
202202
}.toSet ++
203203
missingKeyInRight.flatMap { k =>
204204
val leftValue = aMap(k)
205-
Option(k + ": " + leftValue + " -> ")
205+
Option(k.toString + ": " + leftValue + " -> ")
206206
}.toSet
207207

208208
val shortName = Differ.simpleClassName(aMap)

scalactic/src/main/scala/org/scalactic/anyvals/NonEmptyString.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ final class NonEmptyString private (val theString: String) extends AnyVal {
841841
//NonEmptyString("test")
842842
new NonEmptyString(
843843
theString.map { c =>
844-
f(c) + ""
844+
f(c).toString
845845
}.mkString
846846
)
847847
}

scalatest.dotty/src/main/scala/org/scalatest/diagrams/Diagrams.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ object Diagrams extends Diagrams {
362362
requireNonNull(clue)
363363
if (!bool.value) {
364364
val failureMessage =
365-
Some(clue + Prettifier.lineSeparator + Prettifier.lineSeparator + renderDiagram(sourceText, bool.anchorValues))
365+
Some(clue.toString + Prettifier.lineSeparator + Prettifier.lineSeparator + renderDiagram(sourceText, bool.anchorValues))
366366
throw newAssertionFailedException(failureMessage, None, pos, Vector.empty)
367367
}
368368
Succeeded
@@ -379,7 +379,7 @@ object Diagrams extends Diagrams {
379379
requireNonNull(clue)
380380
if (!bool.value) {
381381
val failureMessage =
382-
Some(clue + Prettifier.lineSeparator + Prettifier.lineSeparator + renderDiagram(sourceText, bool.anchorValues))
382+
Some(clue.toString + Prettifier.lineSeparator + Prettifier.lineSeparator + renderDiagram(sourceText, bool.anchorValues))
383383
throw newTestCanceledException(failureMessage, None, pos)
384384
}
385385
Succeeded

scalatest/src/main/scala/org/scalatest/tools/DashboardReporter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ private[scalatest] class DashboardReporter(directory: String,
165165
if (summaryFile.exists)
166166
summaryFile.renameTo(
167167
new File(
168-
summariesDir + "/summary-" + previousRunTimestamp.get + ".xml"))
168+
summariesDir.toString + "/summary-" + previousRunTimestamp.get + ".xml"))
169169

170170
if (durationsFile.exists)
171171
durationsFile.renameTo(
172172
new File(
173-
durationsDir + "/duration-" + previousRunTimestamp.get + ".xml"))
173+
durationsDir.toString + "/duration-" + previousRunTimestamp.get + ".xml"))
174174

175175
purgeDir(summariesDir, "summary-")
176176
purgeDir(durationsDir, "duration-")

0 commit comments

Comments
 (0)