From c784258b52ae10ae1bd173c519a880f192be581d Mon Sep 17 00:00:00 2001 From: Jon Pretty Date: Mon, 1 Jul 2024 08:11:30 +0200 Subject: [PATCH] Renamed `msg""` to `m""` --- src/core/numbermacros.scala | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/numbermacros.scala b/src/core/numbermacros.scala index 2308918..da5c70c 100644 --- a/src/core/numbermacros.scala +++ b/src/core/numbermacros.scala @@ -24,12 +24,12 @@ import scala.compiletime.* object Cardinality: given Realm = realm"cardinality" - + def apply[LeftDoubleType <: Double: Type, RightDoubleType <: Double: Type](digits: Expr[String])(using Quotes) : Expr[LeftDoubleType ~ RightDoubleType] = import quotes.reflect.* - + digits.value match case Some(string) => TypeRepr.of[LeftDoubleType].asMatchable match @@ -37,20 +37,20 @@ object Cardinality: TypeRepr.of[RightDoubleType].asMatchable match case ConstantType(DoubleConstant(upperBound)) => val value = string.toDouble - + if value < lowerBound - then abandon(msg"""the value $string is less than the lower bound for this value, + then abandon(m"""the value $string is less than the lower bound for this value, ${lowerBound.toString}""") - + if value > upperBound - then abandon(msg"""the value $string is greater than the upper bound for this value, + then abandon(m"""the value $string is greater than the upper bound for this value, ${upperBound.toString}""") - + '{${Expr(value)}.asInstanceOf[LeftDoubleType ~ RightDoubleType]} - + case _ => - abandon(msg"the upper bound must be a Double singleton literal types") + abandon(m"the upper bound must be a Double singleton literal types") case _ => - abandon(msg"the lower bound must be a Double singleton literal types") + abandon(m"the lower bound must be a Double singleton literal types") case None => '{NumericRange($digits.toDouble)}