Skip to content

Commit 1d06666

Browse files
committed
get rid of AnyRefMap, it's deprecated
1 parent 06a88c3 commit 1d06666

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

laws/src/main/scala/Generator.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,8 @@ object AllStrLongGenerators {
472472
val weakHashMap = register(io.MutKV)(_.weakHashMap())
473473
}
474474

475-
object MutKrefV {
476-
val anyRefMap = register(io.MutKrefV)(_.anyRefMap())
477-
}
478-
479475
/** This line is needed to actually perform the registration of all generators! */
480-
val force = ImmKV :: MutKV :: MutKrefV :: Nil
476+
val force = ImmKV :: MutKV :: Nil
481477

482478
lazy val all = everyoneBuffer.result()
483479

laws/src/main/scala/Instantiator.scala

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -509,30 +509,6 @@ object InstantiatorsOfStrLong extends InstantiatorsOf[(String, Long)] with Insta
509509
protected implicit def classTagA: ClassTag[(String, Long)] = ClassTagSource.classTagStringLong
510510
protected def allFlags = Array[Flag]()
511511

512-
protected implicit val sizeOfAnyRefMap_String_Long: Sizable[collection.mutable.AnyRefMap[String, Long]] =
513-
new Sizable[collection.mutable.AnyRefMap[String, Long]] {
514-
def sizeof(m: collection.mutable.AnyRefMap[String, Long]) = m.size
515-
}
516-
517-
object MutKrefV extends Instance.PackagePath {
518-
// If we have other (String, _) types, move this out into a trait
519-
def nickname = "MutKrefV"
520-
def fullyQualified = "scala.collection.mutable"
521-
def C[CC: TypeTag: Sizable](ccf: Array[(String, Long)] => CC, flags: Flag*)(implicit nm: sourcecode.Name): Deployed[(String, Long), CC] = {
522-
val gen = kvInst.makeWith(ccf, (MAP +: flags): _*)(nm, implicitly[TypeTag[CC]], implicitly[Sizable[CC]])
523-
val ans = new Deployed[(String, Long), CC]{
524-
val secretly = gen
525-
var accesses: Int = 0
526-
val name = nm.value.toString
527-
def group = typeTagA.tpe.toString + " in " + nickname
528-
def apply(): Instance.FromArray[(String, Long), CC] = { accesses += 1; secretly }
529-
}
530-
registry += ans
531-
ans
532-
}
533-
val anyRefMap = C({ a => val m = new collection.mutable.AnyRefMap[String, Long]; for (kv <- a) m += kv; m }, SPECTYPE)
534-
}
535-
536512
lazy val possible_a = Array("wish" -> 3L)
537513
lazy val possible_x = Array(
538514
Array.empty[(String, Long)],
@@ -547,5 +523,5 @@ object InstantiatorsOfStrLong extends InstantiatorsOf[(String, Long)] with Insta
547523
*
548524
* In particular, notice that we're only taking the key-value instantiators, so we only register maps, not all collections.
549525
*/
550-
val force = ImmKV :: MutKV :: MutKrefV :: Nil
526+
val force = ImmKV :: MutKV :: Nil
551527
}

0 commit comments

Comments
 (0)