Enable scala 2.13 (fixing #344)#368
Conversation
|
@cquiroz could have a look on this one please? |
|
Seconding @ybasket: squants is the last thing holding us back from migrating to 2.13 for several projects :) |
cquiroz
left a comment
There was a problem hiding this comment.
This looks good to me with a minor comment about the imports
| import squants._ | ||
| import squants.space.{ Feet, Millimeters, UsMiles } | ||
| import squants.time.{ Seconds, TimeDerivative, TimeIntegral, SecondTimeDerivative, TimeSquared, Time } | ||
| import squants.{AbstractQuantityNumeric, Dimension, PrimaryUnit, Quantity, SiUnit, UnitConverter, UnitOfMeasure} |
There was a problem hiding this comment.
Why these changes? Is it due to the IDE reorganizing it?
There was a problem hiding this comment.
No, avoiding the import of squants._ as this was causing the compilation problems due the type aliases defined there. Not beautiful, but has to be like this at least until scala/bug#11734 is resolved.
There was a problem hiding this comment.
Ok, thanks for the clarification
|
|
||
| object KineticEnergy { | ||
| def apply(mass: Mass, velocity: Velocity): Energy = | ||
| def apply(mass: Mass, velocity: squants.motion.Velocity): Energy = |
There was a problem hiding this comment.
Why do we use the full name?
There was a problem hiding this comment.
We're in the package squants, so the only way to avoid picking up the problematic type aliases in the squants companion object are fully qualified names.
| } | ||
|
|
||
| object SquantsNumeric { | ||
| object SquantsNumeric extends ScalaVersionSpecificNumericInstances { |
|
Thanks @ybasket for your PR |
|
LGTM, good work on finding a way around the issue, @ybasket |
|
If there are no objections, I am OK with merging this. |
|
I plan to merge some PRs and do a release today |
|
Great, thanks! 🎉 |
WIP as it is based on the not yet merged #363 (will rebase asap, for now just ignore the first two commits) and tests didn't compile for native (seems expected), so I let Travis check.I found a work-around for scala/bug#11734 (avoiding the indirection via the type aliases in the
squantspackage object, see 8cab981). Based on that the PR contains the usual small things to enable the cross build for 2.13, like adapting the build definitions and introducing a small version dependent trait for the tests asOrdering.FloatOrderinggot split in 2.13.fixes #344