diff --git a/build.sc b/build.sc index bf33fbfc..5a3583f0 100644 --- a/build.sc +++ b/build.sc @@ -7,7 +7,7 @@ import mill._, define._, api.Result import scalalib._, scalalib.scalafmt._, scalalib.publish._, scalajslib._, scalanativelib._ object versions { - val scala = "3.3.1" + val scala = "3.3.3" val scalaJS = "1.13.2" val scalaNative = "0.4.15" } diff --git a/main/src/io/github/iltotore/iron/constraint/any.scala b/main/src/io/github/iltotore/iron/constraint/any.scala index 4ca7a92f..bc1745ff 100644 --- a/main/src/io/github/iltotore/iron/constraint/any.scala +++ b/main/src/io/github/iltotore/iron/constraint/any.scala @@ -184,12 +184,14 @@ object any: object StrictEqual: - private trait StrictEqualConstraint[A, V] extends Constraint[A, StrictEqual[V]]: + trait StrictEqualConstraint[A, V] extends Constraint[A, StrictEqual[V]]: override inline def message: String = "Should strictly equal to " + stringValue[V] - inline given [A, V]: StrictEqualConstraint[A, V] with + class AnyStrictEqualConstraint[A, V] extends StrictEqualConstraint[A, V]: override inline def test(value: A): Boolean = value == constValue[V] + inline given [A, V](using inline v: ValueOf[V]): AnyStrictEqualConstraint[A, V] = new AnyStrictEqualConstraint + inline given bigDecimalDouble[V <: Float | Double]: StrictEqualConstraint[BigDecimal, V] with override inline def test(value: BigDecimal): Boolean = value == BigDecimal(doubleValue[V])