util/util-core: Fix conversions to units from Int in Scala3#296
util/util-core: Fix conversions to units from Int in Scala3#296felixbr wants to merge 2 commits intotwitter:developfrom
Conversation
|
Would it make sense to update Scala from |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #296 +/- ##
========================================
Coverage 52.62% 52.63%
========================================
Files 316 316
Lines 16856 16859 +3
Branches 1010 1009 -1
========================================
+ Hits 8871 8873 +2
- Misses 7985 7986 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Intvalues in Scala3. As discussed in #295 I extracted/adapted this from #290 (previous discussion).Previously something like
1.toInt.seconddid compile in Scala2 (with default settings) but didn't in Scala3.I added forwarders for all units which use
Longas base, as that seemed reasonable and safe. I didn't add an implicit conversion fromFloattoDoublebecause 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.