Closed sethaxen closed 6 months ago
If we just make everything @generated
it will be stable on all versions !
But seriously I guess we can specialise to v1.10, or add a Compat.jl dep
I've done the Compat.jl dependency elsewhere and it's been fine. I'm not really certain the trade-offs of that vs inlining.
I missed that you said @inline
worked as well as @constprop
, we can just use that.
Calling reductions like
maximum
on Julia v1.10.0 is not type-inferrable:Ultimately we're hitting the following line: https://github.com/rafaqz/DimensionalData.jl/blob/d927b773cd3243fc3c949371a3371938898fd811/src/array/methods.jl#L20-L21 so I thought inlining a call to that method directly might be type-stable, but nope.
But if I just implement the identical function myself, it just works.
So I checked, and decorating the following with
@inline
orBase.@constprop :aggressive
causesmaximum
to be type-inferrable: https://github.com/rafaqz/DimensionalData.jl/blob/d927b773cd3243fc3c949371a3371938898fd811/src/array/methods.jl#L20-L21