Iltotore / iron

Strong type constraints for Scala
https://iltotore.github.io/iron/docs/
Apache License 2.0
457 stars 43 forks source link

refactor: Remove Java's BigInt/BigDecimal constraints #146

Closed Iltotore closed 1 year ago

Iltotore commented 1 year ago

Closes #145

ajaychandran commented 1 year ago

@Iltotore Should the instances for StrictEqual be removed as well?


    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])
Iltotore commented 1 year ago

@Iltotore Should the instances for StrictEqual be removed as well?

Good catch. Yes they should.