From 008fc6c7bdf764d033f668f8da2577958026e6ca Mon Sep 17 00:00:00 2001 From: Erik Erlandson Date: Tue, 26 Dec 2023 09:41:31 -0700 Subject: [PATCH] cannot inline fromInt or fromDouble due to multiple inheritance --- core/src/main/scala-3/spire/std/double.scala | 4 ++-- core/src/main/scala/spire/math/Numeric.scala | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala-3/spire/std/double.scala b/core/src/main/scala-3/spire/std/double.scala index 1845bec4b..ec61f2ba1 100644 --- a/core/src/main/scala-3/spire/std/double.scala +++ b/core/src/main/scala-3/spire/std/double.scala @@ -31,9 +31,9 @@ trait DoubleIsField extends Field[Double] { override inline def times(a: Double, b: Double): Double = a * b inline def zero: Double = 0.0 - override inline def fromInt(n: Int): Double = n.toDouble + override def fromInt(n: Int): Double = n - override inline def fromDouble(n: Double): Double = n + override def fromDouble(n: Double): Double = n inline def div(a: Double, b: Double): Double = a / b } diff --git a/core/src/main/scala/spire/math/Numeric.scala b/core/src/main/scala/spire/math/Numeric.scala index 297652ea3..7928aaad0 100644 --- a/core/src/main/scala/spire/math/Numeric.scala +++ b/core/src/main/scala/spire/math/Numeric.scala @@ -185,6 +185,8 @@ private[math] class DoubleIsNumeric with ConvertableToDouble with DoubleIsReal with Serializable { + override def fromInt(n: Int): Double = n + override def fromDouble(n: Double): Double = n override def fromBigInt(n: BigInt): Double = n.toDouble override def toDouble(n: Double): Double = n.toDouble override def toRational(n: Double): Rational = super[DoubleIsReal].toRational(n)