Skip to content

Commit

Permalink
v5.0.8-RC: addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aslesarenko committed Jun 2, 2023
1 parent 7ca8759 commit 4efe077
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
3 changes: 0 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand Down
2 changes: 1 addition & 1 deletion graph-ir/src/main/scala/scalan/MethodCalls.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 4efe077

Please sign in to comment.