The problem is that Dense<D> also carries runtime information for D. In the implementation above this information is not adapter, so you end up with a value thinking it's Dense<D> when at runtime it's still Dense<S>. You can see this in effect when trying to round the resulting Dense<D> - it will try to look up the target unit under source format's scale table.
The type of
exchange
is currentlyThe problem is that
Dense<D>
also carries runtime information forD
. In the implementation above this information is not adapter, so you end up with a value thinking it'sDense<D>
when at runtime it's stillDense<S>
. You can see this in effect when trying to round the resultingDense<D>
- it will try to look up the target unit under source format's scale table.