Skip to content

Commit 0b4e871

Browse files
committed
Start fixing ambiguities
1 parent 41947d1 commit 0b4e871

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/abstractblocksparsearray/views.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,18 @@ function Base.view(
189189
) where {T,N}
190190
return viewblock(a, block...)
191191
end
192+
# Fix ambiguity error with BlockArrays.jl.
193+
function Base.view(
194+
a::SubArray{
195+
T,
196+
N,
197+
<:AbstractBlockSparseArray{T,N},
198+
<:Tuple{Vararg{Union{Base.Slice,BlockSlice{Union{},<:Integer}},N}},
199+
},
200+
block::Block{N},
201+
) where {T,N}
202+
return viewblock(a, block)
203+
end
192204

193205
# XXX: TODO: Distinguish if a sub-view of the block needs to be taken!
194206
# Define a new `SubBlockSlice` which is used in:
@@ -327,6 +339,11 @@ function BlockArrays.viewblock(
327339
end
328340
return @view parent(a)[brs...]
329341
end
342+
343+
## function BlockArrays.viewblock
344+
## a::SubArray{
345+
## T,N,<:AbstractBlockSparseArray{T,N},<:Tuple{Vararg{Union{Base.Slice, BlockArrays.BlockSlice{Union{}, T} where T<:Integer, BlockSparseArrays.BlockIndices{Union{}, T} where T<:Integer},N}}, ::Vararg{Block{1}, N}) where {T, N}
346+
330347
# TODO: Define `@interface interface(a) viewblock`.
331348
function BlockArrays.viewblock(
332349
a::SubArray{

0 commit comments

Comments
 (0)