From 796b4735717bed46498ed663e6b3fa3e40d712fd Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Thu, 25 Jan 2024 20:15:50 +0900 Subject: [PATCH] add BigDecimal and BigInt cache in RefineMacro --- .../eu/timepit/refined/macros/RefineMacro.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/core/shared/src/main/scala-3.0-/eu/timepit/refined/macros/RefineMacro.scala b/modules/core/shared/src/main/scala-3.0-/eu/timepit/refined/macros/RefineMacro.scala index 10c669d1c..119adf834 100644 --- a/modules/core/shared/src/main/scala-3.0-/eu/timepit/refined/macros/RefineMacro.scala +++ b/modules/core/shared/src/main/scala-3.0-/eu/timepit/refined/macros/RefineMacro.scala @@ -84,6 +84,18 @@ class RefineMacro(val c: blackbox.Context) extends MacroUtils with LiteralMatche instance[Char, LowerCase], instance[Char, UpperCase], instance[Char, Whitespace] + ), + weakTypeOf[BigInt] -> List( + instance[BigInt, Positive], + instance[BigInt, NonPositive], + instance[BigInt, Negative], + instance[BigInt, NonNegative] + ), + weakTypeOf[BigDecimal] -> List( + instance[BigDecimal, Positive], + instance[BigDecimal, NonPositive], + instance[BigDecimal, Negative], + instance[BigDecimal, NonNegative] ) ) }