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:
|
@generated function single_seed(::Type{Partials{N,V}}, ::Val{i}) where {N,V,i} |
|
ex = Expr(:tuple, [ifelse(i === j, :(one(V)), :(zero(V))) for j in 1:N]...) |
|
return :(Partials($(ex))) |
|
end |
Maybe using
oneunit there is more correct?