`construct_seeds` for types where `typeof(one(T)) !=T` is broken
longemen3000 opened this issue · 1 comments
longemen3000 commented
as far as i understand, the type of one(T)
is not necessarily T
(JuliaPhysics/Measurements.jl#134 for example). but construct_seeds
uses this:
ForwardDiff.jl/src/partials.jl
Lines 9 to 12 in 50ec9a1
Maybe using
oneunit
there is more correct?stevengj commented
If you want to get something of the same type, you should use oneunit
, that's what it's for.
(e.g. for a dimensionful type, one
must be dimensionless, i.e. of a different type, as otherwise it will not be a multiplicative identity.)