Open lkdvos opened 2 weeks ago
This should be fixed by https://github.com/JuliaArrays/BlockArrays.jl/pull/429, but this would work only within a function, and not at the top-level. This is because the dimension needs to be constant-propagated, and such optimizations won't happen at the top level.
I'm running into a subtle type-instability with
blocksizes
, which breaks the type-inference of a function I am trying to define further down the line.I did some digging, and it seems that the culprit is that
Base.axes(::AbstractArray, n)
will output aOneTo
whenevern
is larger than the number of dimensions. It seems like the compiler isn't able to const-propagate then
to figure this out. I was wondering if there is a way to avoid this instability, maybe by defining a fallback foraxes(::AbstractBlockArray, d::Int)
to output aBlockedOneTo
instead?I can definitely open a PR to make changes and tests, I just wanted to ask for some comments and feedback first.