Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Java BigDecimal and BigInteger instances #179

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions main/src/io/github/iltotore/iron/constraint/any.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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])
4 changes: 0 additions & 4 deletions main/test/src/io/github/iltotore/iron/testing/AnySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
Loading