Skip to content

Commit

Permalink
scala-native 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Aug 25, 2024
1 parent 03f6b58 commit 6032258
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
if (scalaBinaryVersion.value == "3") {
Seq(
"com.github.scalaprops" %%% "scalaprops-gen" % scalapropsVersion.value,
"org.typelevel" %%% "shapeless3-deriving" % "3.4.1"
"org.typelevel" %%% "shapeless3-deriving" % "3.4.3"
)
} else {
Seq(
"com.github.scalaprops" %%% "scalaprops-core" % scalapropsVersion.value,
"com.chuusai" %%% "shapeless" % "2.3.11"
"com.chuusai" %%% "shapeless" % "2.3.12"
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scalaprops

import shapeless3.deriving.K0
import scala.deriving.Mirror

sealed abstract class ScalapropsShapelessInstances {

Expand Down Expand Up @@ -32,13 +33,13 @@ sealed abstract class ScalapropsShapelessInstances {
(x, y.get)
)

inline implicit def genCoproduct[A](using inst: => K0.CoproductInstances[Gen, A]): Gen[A] =
inline implicit def genCoproduct[A](using inst: => K0.CoproductInstances[Gen, A], mirror: Mirror.SumOf[A]): Gen[A] =
Gen.gen[A]((size, r1) =>
val (r2, i) = r1.nextInt
val index = if (i == Int.MinValue) {
0
} else {
i.abs % inst.is.length
i.abs % valueOf[Tuple.Size[mirror.MirroredElemTypes]]
}
inst.inject[(Rand, A)](index) {
[t <: A] => (g: Gen[t]) => g.f(size, r2)
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("com.github.scalaprops" % "sbt-scalaprops" % "0.4.4")
addSbtPlugin("com.github.scalaprops" % "sbt-scalaprops" % "0.5.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.5")

0 comments on commit 6032258

Please sign in to comment.