From 2cf8f64d0a269406f7359dbe7d6bdae91f60c024 Mon Sep 17 00:00:00 2001 From: Ajay Chandran Date: Thu, 5 Oct 2023 21:25:44 +0000 Subject: [PATCH] Remove Java BigDecimal and BigInteger instances --- .../src/io/github/iltotore/iron/constraint/any.scala | 12 ------------ .../io/github/iltotore/iron/testing/AnySuite.scala | 4 ---- 2 files changed, 16 deletions(-) diff --git a/main/src/io/github/iltotore/iron/constraint/any.scala b/main/src/io/github/iltotore/iron/constraint/any.scala index 55b5321d..4ca7a92f 100644 --- a/main/src/io/github/iltotore/iron/constraint/any.scala +++ b/main/src/io/github/iltotore/iron/constraint/any.scala @@ -198,15 +198,3 @@ object any: inline given [V <: Int | Long]: StrictEqualConstraint[BigInt, V] with override inline def test(value: BigInt): Boolean = value == BigInt(longValue[V]) - - inline given jBigDecimalDouble[V <: Float | Double]: StrictEqualConstraint[java.math.BigDecimal, V] with - override inline def test(value: java.math.BigDecimal): Boolean = - value == java.math.BigDecimal.valueOf(doubleValue[V]) - - inline given jBigDecimalLong[V <: Int | Long]: StrictEqualConstraint[java.math.BigDecimal, V] with - override inline def test(value: java.math.BigDecimal): Boolean = - value == java.math.BigDecimal.valueOf(longValue[V]) - - inline given jBigInteger[V <: Int | Long]: StrictEqualConstraint[java.math.BigInteger, V] with - override inline def test(value: java.math.BigInteger): Boolean = - value == java.math.BigInteger.valueOf(longValue[V]) diff --git a/main/test/src/io/github/iltotore/iron/testing/AnySuite.scala b/main/test/src/io/github/iltotore/iron/testing/AnySuite.scala index 5c4cbb72..d5b5e074 100644 --- a/main/test/src/io/github/iltotore/iron/testing/AnySuite.scala +++ b/main/test/src/io/github/iltotore/iron/testing/AnySuite.scala @@ -47,10 +47,6 @@ object AnySuite extends TestSuite: test - BigDecimal(1).assertNotRefine[StrictEqual[0]] test - BigInt(0).assertRefine[StrictEqual[0]] test - BigInt(1).assertNotRefine[StrictEqual[0]] - test - java.math.BigDecimal("0").assertRefine[StrictEqual[0]] - test - java.math.BigDecimal("1").assertNotRefine[StrictEqual[0]] - test - java.math.BigInteger("0").assertRefine[StrictEqual[0]] - test - java.math.BigInteger("1").assertNotRefine[StrictEqual[0]] } test("in") {