diff --git a/build.sbt b/build.sbt index 928d9e02bd..269ad14997 100644 --- a/build.sbt +++ b/build.sbt @@ -82,8 +82,6 @@ val scrypto = "org.scorexfoundation" %% "scrypto" % "2.3.0" val scryptoDependency = libraryDependencies += "org.scorexfoundation" %%% "scrypto" % "2.3.0" -//val scorexUtil = "org.scorexfoundation" %% "scorex-util" % "0.1.8" -//val debox = "org.scorexfoundation" %% "debox" % "0.9.0" val scorexUtil = "org.scorexfoundation" %% "scorex-util" % "0.2.0" val scorexUtilDependency = libraryDependencies += "org.scorexfoundation" %%% "scorex-util" % "0.2.0" @@ -241,7 +239,6 @@ lazy val interpreter = crossProject(JVMPlatform, JSPlatform) crossScalaSettingsJS, libraryDependencies ++= Seq ( "org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0" -// ("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13) ), useYarn := true ) diff --git a/common/shared/src/main/scala/scalan/util/CollectionUtil.scala b/common/shared/src/main/scala/scalan/util/CollectionUtil.scala index f4086381a7..10042b5b78 100644 --- a/common/shared/src/main/scala/scalan/util/CollectionUtil.scala +++ b/common/shared/src/main/scala/scalan/util/CollectionUtil.scala @@ -213,7 +213,7 @@ object CollectionUtil { * @tparam B the type of the elements in the other structure, a supertype of A * @return true if the two nested structures have the same elements in the same order, false otherwise */ - def sameElements2[B >: A](that: GenIterable[B]): Boolean = { + def sameElementsNested[B >: A](that: GenIterable[B]): Boolean = { val i1: Iterator[Any] = flattenIter(xs.iterator) val i2: Iterator[Any] = flattenIter(that.iterator) i1.sameElements(i2) diff --git a/common/shared/src/test/scala/scalan/util/CollectionUtilTests.scala b/common/shared/src/test/scala/scalan/util/CollectionUtilTests.scala index 60c49a3bee..457bef4436 100644 --- a/common/shared/src/test/scala/scalan/util/CollectionUtilTests.scala +++ b/common/shared/src/test/scala/scalan/util/CollectionUtilTests.scala @@ -125,15 +125,15 @@ class CollectionUtilTests extends BaseTests { } test("sameElements2") { - Seq(1, 2).sameElements2(List(1, 2)) shouldBe true - new mutable.WrappedArray.ofInt(Array(1, 2)).sameElements2(Vector(1, 2)) shouldBe true - Seq(new mutable.WrappedArray.ofInt(Array(1, 2)), 3).sameElements2(Array(Vector(1, 2), 3)) shouldBe true - Seq(Array(1, 2), 3).sameElements2(Array(Vector(1, 2), 3)) shouldBe true - Seq(Array(1, 2), Option(3)).sameElements2(Array(Vector(1, 2), List(3))) shouldBe false - - Seq(1, 2).sameElements2(List(1, 2, 3)) shouldBe false - new mutable.WrappedArray.ofInt(Array(1, 2, 3)).sameElements2(Vector(1, 2)) shouldBe false - Seq(new mutable.WrappedArray.ofInt(Array(1, 2, 3)), 3).sameElements2(Array(Vector(1, 2), 3)) shouldBe false + Seq(1, 2).sameElementsNested(List(1, 2)) shouldBe true + new mutable.WrappedArray.ofInt(Array(1, 2)).sameElementsNested(Vector(1, 2)) shouldBe true + Seq(new mutable.WrappedArray.ofInt(Array(1, 2)), 3).sameElementsNested(Array(Vector(1, 2), 3)) shouldBe true + Seq(Array(1, 2), 3).sameElementsNested(Array(Vector(1, 2), 3)) shouldBe true + Seq(Array(1, 2), Option(3)).sameElementsNested(Array(Vector(1, 2), List(3))) shouldBe false + + Seq(1, 2).sameElementsNested(List(1, 2, 3)) shouldBe false + new mutable.WrappedArray.ofInt(Array(1, 2, 3)).sameElementsNested(Vector(1, 2)) shouldBe false + Seq(new mutable.WrappedArray.ofInt(Array(1, 2, 3)), 3).sameElementsNested(Array(Vector(1, 2), 3)) shouldBe false } diff --git a/graph-ir/src/main/scala/scalan/MethodCalls.scala b/graph-ir/src/main/scala/scalan/MethodCalls.scala index b1bf67ebe6..d300d0765a 100644 --- a/graph-ir/src/main/scala/scalan/MethodCalls.scala +++ b/graph-ir/src/main/scala/scalan/MethodCalls.scala @@ -72,7 +72,7 @@ trait MethodCalls extends Base { self: Scalan => neverInvoke == other.neverInvoke && isAdapterCall == other.isAdapterCall && args.length == other.args.length && - args.sameElements2(other.args) // this is required in case method have T* arguments + args.sameElementsNested(other.args) // this is required in case method have T* arguments case _ => false } }