From 0ee04b03a24f89b3d67db35d2b2f0688269946b8 Mon Sep 17 00:00:00 2001 From: sh0hei Date: Fri, 15 Jun 2018 20:37:33 +0900 Subject: [PATCH] Add NumericTypesBinCompat1 for binary compatible --- .../scala/eu/timepit/refined/types/all.scala | 2 +- .../eu/timepit/refined/types/numeric.scala | 51 ++++++++++--------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/modules/core/shared/src/main/scala/eu/timepit/refined/types/all.scala b/modules/core/shared/src/main/scala/eu/timepit/refined/types/all.scala index 0128cec7c..161ad0c76 100644 --- a/modules/core/shared/src/main/scala/eu/timepit/refined/types/all.scala +++ b/modules/core/shared/src/main/scala/eu/timepit/refined/types/all.scala @@ -7,6 +7,6 @@ trait AllTypes extends CharTypes with DigestTypes with NetTypes - with NumericTypes + with NumericTypes with NumericTypesBinCompat1 with StringTypes with TimeTypes diff --git a/modules/core/shared/src/main/scala/eu/timepit/refined/types/numeric.scala b/modules/core/shared/src/main/scala/eu/timepit/refined/types/numeric.scala index b1dcc5513..8e8334685 100644 --- a/modules/core/shared/src/main/scala/eu/timepit/refined/types/numeric.scala +++ b/modules/core/shared/src/main/scala/eu/timepit/refined/types/numeric.scala @@ -1,5 +1,6 @@ package eu.timepit.refined.types +import eu.timepit.refined import eu.timepit.refined.api.{Refined, RefinedTypeOps} import eu.timepit.refined.numeric.{Negative, NonNegative, NonPositive, Positive} @@ -128,30 +129,6 @@ object numeric { } trait NumericTypes { - final type PosByte = numeric.PosByte - final val PosByte = numeric.PosByte - - final type NonNegByte = numeric.NonNegByte - final val NonNegByte = numeric.NonNegByte - - final type NegByte = numeric.NegByte - final val NegByte = numeric.NegByte - - final type NonPosByte = numeric.NonPosByte - final val NonPosByte = numeric.NonPosByte - - final type PosShort = numeric.PosShort - final val PosShort = numeric.PosShort - - final type NonNegShort = numeric.NonNegShort - final val NonNegShort = numeric.NonNegShort - - final type NegShort = numeric.NegShort - final val NegShort = numeric.NegShort - - final type NonPosShort = numeric.NonPosShort - final val NonPosShort = numeric.NonPosShort - final type PosInt = numeric.PosInt final val PosInt = numeric.PosInt @@ -200,3 +177,29 @@ trait NumericTypes { final type NonPosDouble = numeric.NonPosDouble final val NonPosDouble = numeric.NonPosDouble } + +trait NumericTypesBinCompat1 { + final type PosByte = numeric.PosByte + final val PosByte = numeric.PosByte + + final type NonNegByte = numeric.NonNegByte + final val NonNegByte = refined.types.numeric.NonNegByte + + final type NegByte = numeric.NegByte + final val NegByte = numeric.NegByte + + final type NonPosByte = numeric.NonPosByte + final val NonPosByte = refined.types.numeric.NonPosByte + + final type PosShort = numeric.PosShort + final val PosShort = numeric.PosShort + + final type NonNegShort = numeric.NonNegShort + final val NonNegShort = numeric.NonNegShort + + final type NegShort = numeric.NegShort + final val NegShort = numeric.NegShort + + final type NonPosShort = numeric.NonPosShort + final val NonPosShort = numeric.NonPosShort +} \ No newline at end of file