Skip to content

Commit

Permalink
Handle unitless multiplication case
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 25, 2024
1 parent e3ea00d commit 3f58ea8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/quantity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ object QuantitativeMacros:
${QuantitativeMacros.multiply[LeftType, RightType]('left, 'right, false)}
.asInstanceOf[Quantity[resultType]]
}

case None =>
'{
new MulOperator[Quantity[LeftType], Quantity[RightType]]:
type Result = Double
def div(left: Quantity[LeftType], right: Quantity[RightType]): Double =
${QuantitativeMacros.multiply[LeftType, RightType]('left, 'right, false)}.asInstanceOf[Double]
}


def divTypeclass
[LeftType <: Measure: Type, RightType <: Measure: Type]
Expand Down

0 comments on commit 3f58ea8

Please sign in to comment.