Skip to content

Commit cac1133

Browse files
authored
Better check when blockreshape is type unstable (#170)
1 parent 5a39292 commit cac1133

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.9.2"
4+
version = "0.9.3"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

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(eltype(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)