Missing operation: truncating tToInstant
for Long
-based time values
#413
Replies: 5 comments 4 replies
-
@benhutchison my take on this was that conversion to java |
Beta Was this translation helpful? Give feedback.
-
To be clear, I don't care about possible truncation on |
Beta Was this translation helpful? Give feedback.
-
Ok, so I'm still a bit confused, having trouble joining some of the dots between my original problem and your hints. I'll try to explain. I observed that I saw it needs an In turn it needs:
It seems that So in my original post ☝️ I assumed the solution was
But your reply above suggested another approach involving implicit conversions, but I'm not sure how this is intended to work. What would be converted, would it be eg TruncatingDeltaUnitConversion => DeltaUnitConversion? |
Beta Was this translation helpful? Give feedback.
-
OK, I've realised some of my conclusions/statements above were wrong and I was misunderstanding the problem. I'm going to start a new thread because the title of this one is misaligned with the problem I'm seeing now. I'll try and start with the actual problem Im seeing. But I'll mention that
|
Beta Was this translation helpful? Give feedback.
-
Think I finally minimized the issue. Minimisation is hard work 😓 |
Beta Was this translation helpful? Give feedback.
-
I realised there's a missing operation in the
time
module.toInstant
is non-truncating and is backed by conversions for fraction value types likeDouble
. But there's currently notToInstant
for discrete value types likeLong
.It's counter-intuitive to think of truncation occurring when converting to an Instant, but it's theoretically possible if the time value was in nanos.
Anyway, Coulombs machinery wants truncating conversions for
Long
; ie intime.scala
,EpochTimeInstant
is built fromDeltaUnitConversion
, but what's needed is a cousinTruncatingEpochTimeInstant
built from aTruncatingDeltaUnitConversion
.Beta Was this translation helpful? Give feedback.
All reactions