Skip to content

Commit de59b37

Browse files
committed
Better check when blockreshape is type unstable
1 parent d2fb3a4 commit de59b37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BlockArraysExtensions/BlockArraysExtensions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function _blockreshape(a::AbstractArray, axes::Tuple{Vararg{AbstractUnitRange}})
278278
return reshape(reshaped_blocks_a[I], block_axes_I)
279279
end
280280
bs = Dict(Block(Tuple(I)) => f(I) for I in eachstoredindex(reshaped_blocks_a))
281-
if !isconcretetype(valtype(bs))
281+
if !isconcretetype(keytype(bs)) || !isconcretetype(valtype(bs))
282282
# This branch only seems to be required in Julia 1.10, not Julia 1.11.
283283
# TODO: Remove this branch once Julia 1.10 support is dropped.
284284
bs = Dict{Block{length(axes),Int},AbstractArray{eltype(a),length(axes)}}()

0 commit comments

Comments
 (0)