diff --git a/src/blockindices.jl b/src/blockindices.jl index bc538a06..b1b1fc44 100644 --- a/src/blockindices.jl +++ b/src/blockindices.jl @@ -172,7 +172,7 @@ end @inline BlockIndex(::Tuple{}, b::Tuple{}) = BlockIndex{0,Tuple{},Tuple{}}((), ()) @inline BlockIndex(a::Integer, b) = BlockIndex((a,), (b,)) -@inline BlockIndex(a::Tuple, b) = BlockIndex(a, (b,)) +@inline BlockIndex(a::NTuple{N, Integer}, b) where {N} = BlockIndex(a, (b,)) @inline BlockIndex(a::Integer, b::Tuple) = BlockIndex((a,), b) @inline BlockIndex() = BlockIndex((), ()) diff --git a/test/test_blockindices.jl b/test/test_blockindices.jl index 02c87dfc..ef60822d 100644 --- a/test/test_blockindices.jl +++ b/test/test_blockindices.jl @@ -113,6 +113,7 @@ import BlockArrays: split_index, merge_indices @test copy(Block(1)[1:2]) === BlockIndexRange(Block(1),1:2) @test copy(Block(1)[[1,3]]) == BlockIndices(Block(1),[1,3]) @test copy(Block(1)[[1,3]]) ≢ BlockIndices(Block(1),[1,3]) + @test_throws MethodError BlockIndex((1.0, 2.0), (1, 2)) end @testset "BlockIndices" begin