diff --git a/build.sc b/build.sc index 6edb25f0..deb15baf 100644 --- a/build.sc +++ b/build.sc @@ -7,9 +7,9 @@ import mill._, define._, api.Result import scalalib._, scalalib.scalafmt._, scalalib.publish._, scalajslib._, scalanativelib._ object versions { - val scala = "3.2.1" - val scalaJS = "1.12.0" - val scalaNative = "0.4.10" + val scala = "3.3.1" + val scalaJS = "1.13.2" + val scalaNative = "0.4.15" } trait BaseModule extends ScalaModule with ScalafmtModule with CiReleaseModule { outer => diff --git a/cats/src/io/github/iltotore/iron/NegShift.scala b/cats/src/io/github/iltotore/iron/NegShift.scala index de9c630d..18399008 100644 --- a/cats/src/io/github/iltotore/iron/NegShift.scala +++ b/cats/src/io/github/iltotore/iron/NegShift.scala @@ -6,7 +6,11 @@ trait NegShift[A]: object NegShift: - inline given NegShift[Int] = value => value | Int.MinValue - inline given NegShift[Long] = value => value | Long.MinValue - inline given NegShift[Float] = value => if value > 0 then Float.MinValue + value else value - inline given NegShift[Double] = value => if value > 0 then Double.MinValue + value else value + inline given NegShift[Int] with + def shift(value: Int): Int = value | Int.MinValue + inline given NegShift[Long] with + def shift(value: Long): Long = value | Long.MinValue + inline given NegShift[Float] with + def shift(value: Float): Float = if value > 0 then Float.MinValue + value else value + inline given NegShift[Double] with + def shift(value: Double): Double = if value > 0 then Double.MinValue + value else value diff --git a/cats/src/io/github/iltotore/iron/PosShift.scala b/cats/src/io/github/iltotore/iron/PosShift.scala index cc1ff216..bc2928a4 100644 --- a/cats/src/io/github/iltotore/iron/PosShift.scala +++ b/cats/src/io/github/iltotore/iron/PosShift.scala @@ -6,7 +6,11 @@ trait PosShift[A]: object PosShift: - inline given PosShift[Int] = value => value & Int.MaxValue - inline given PosShift[Long] = value => value & Long.MaxValue - inline given PosShift[Float] = value => if value < 0 then Float.MaxValue - value else value - inline given PosShift[Double] = value => if value < 0 then Double.MaxValue - value else value + inline given PosShift[Int] with + def shift(value: Int): Int = value & Int.MaxValue + inline given PosShift[Long] with + def shift(value: Long): Long = value & Long.MaxValue + inline given PosShift[Float] with + def shift(value: Float): Float = if value < 0 then Float.MaxValue - value else value + inline given PosShift[Double] with + def shift(value: Double): Double = if value < 0 then Double.MaxValue - value else value