-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util/util-core: Fix conversions to units from Int in Scala3 #296
util/util-core: Fix conversions to units from Int in Scala3 #296
Conversation
Would it make sense to update Scala from |
Codecov Report
@@ Coverage Diff @@
## develop #296 +/- ##
===========================================
- Coverage 52.62% 52.62% -0.01%
===========================================
Files 316 316
Lines 16856 16859 +3
Branches 1010 1009 -1
===========================================
+ Hits 8871 8872 +1
- Misses 7985 7987 +2
Continue to review full report at Codecov.
|
Yes, let's update to 3.02! Was waiting for that release which includes a few bug fixes which first pushed us to using RC1. I'm for including it in CI but I wonder if we need the entire repo crossbuilding before that could work? Now that we have forwarders. If it's not a hassle, is it possible to undo the |
One way to do it is to have a separate aggregate-module or even just an alias which tests only the modules which currently support Scala3.
I did a quick search when I wrote this PR and didn't see any obvious parts where |
The idea was to merge this first and rebase the other one, so the workaround there isn't needed anymore. I can do the rebase and adaptation once this is merged, if you want. |
This fixes lost source-compatibility for unit conversions from
Int
values in Scala3. As discussed in #295 I extracted/adapted this from #290 (previous discussion).Previously something like
1.toInt.second
did compile in Scala2 (with default settings) but didn't in Scala3.I added forwarders for all units which use
Long
as base, as that seemed reasonable and safe. I didn't add an implicit conversion fromFloat
toDouble
because floating-point types are dumb and I don't trust the conversion to be lossless in all cases.I'll adapt #295 once this is merged.