Skip to content

Commit ee24ccb

Browse files
committed
Tests pass for 2.13
1 parent 00c8eed commit ee24ccb

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

build.sbt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ val sharedSettings = Seq(
3131
Nil
3232
case _ => Nil
3333
}),
34+
3435
)
3536

3637
lazy val scalarx = crossProject(JSPlatform, JVMPlatform)
@@ -43,13 +44,18 @@ lazy val scalarx = crossProject(JSPlatform, JVMPlatform)
4344
"com.github.julien-truffaut" %%% "monocle-core" % monocleVersion,
4445
"com.github.julien-truffaut" %%% "monocle-macro" % monocleVersion % "test",
4546
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided,
46-
47+
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.1.2",
4748
"com.lihaoyi" %%% "utest" % "0.6.9" % "test",
4849
"com.lihaoyi" %% "acyclic" % acyclicVersion % "provided"
4950
),
51+
5052
addCompilerPlugin("com.lihaoyi" %% "acyclic" % acyclicVersion),
5153
testFrameworks += new TestFramework("utest.runner.Framework"),
5254
autoCompilerPlugins := true,
55+
/* scalafixDependencies in ThisBuild += "org.scala-lang.modules" %% "scala-collection-migrations" % "2.1.1", */
56+
/* scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on"), */
57+
/* addCompilerPlugin(scalafixSemanticdb), */
58+
/* scalacOptions += "-Yrangepos", */
5359

5460
// Sonatype
5561
publishTo := Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"),

project/build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
88
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")
99

1010
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
11+
12+
13+
/* addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.6") */

scalarx/shared/src/main/scala/rx/Rx.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import rx.opmacros.Factories
55
import scala.annotation.unchecked.uncheckedVariance
66
import scala.collection.mutable
77
import scala.util.Try
8+
import scala.collection.compat._
89

910
/**
1011
* A reactive value of type [[T]]. Keeps track of triggers and
@@ -125,7 +126,7 @@ object Rx {
125126
private[rx] implicit val ordering: Ordering[Dynamic[_]] = Ordering.by[Rx.Dynamic[_], Int](-_.depth)
126127

127128
@inline private[rx] def doRecalcCopy(rxs: Iterable[Rx.Dynamic[_]], obs: Iterable[Obs]): Unit = {
128-
doRecalcMutable(rxs.to[mutable.PriorityQueue], obs.to[mutable.Set])
129+
doRecalcMutable(rxs.to(mutable.PriorityQueue), obs.to(mutable.Set))
129130
}
130131
private[rx] def doRecalcMutable(queue: mutable.PriorityQueue[Rx.Dynamic[_]], observers: mutable.Set[Obs]): Unit = {
131132
val seen = mutable.Set.empty[Rx.Dynamic[_]]

scalarx/shared/src/main/scala/rx/Var.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package rx
22

33
import scala.util.{Success, Try}
4-
import scala.collection.{breakOut, mutable}
4+
import scala.collection.mutable
5+
import scala.collection.compat._
56

67
trait Var[T] extends Rx[T] {
78
def update(newValue: T): Unit
@@ -40,8 +41,8 @@ object Var {
4041
def set(args: Assignment[_]*): Unit = {
4142
args.foreach(_.set())
4243
Rx.doRecalcMutable(
43-
args.flatMap(_.v.downStream)(breakOut),
44-
args.flatMap(_.v.observers)(breakOut)
44+
args.iterator.flatMap(_.v.downStream).to(mutable.PriorityQueue),
45+
args.iterator.flatMap(_.v.observers).to(mutable.Set)
4546
)
4647
}
4748

0 commit comments

Comments
 (0)