We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d22c304 commit b3b9aa0Copy full SHA for b3b9aa0
base/abstractarray.jl
@@ -234,7 +234,7 @@ julia> ndims(A)
234
```
235
"""
236
ndims(::AbstractArray{T,N}) where {T,N} = N
237
-ndims(::Type{<:AbstractArray{T,N}}) where {T,N} = N
+ndims(::Type{<:AbstractArray{<:Any,N}}) where {N} = N
238
239
240
length(collection) -> Integer
test/abstractarray.jl
@@ -835,6 +835,11 @@ end
835
@testset "ndims and friends" begin
836
@test ndims(Diagonal(rand(1:5,5))) == 2
837
@test ndims(Diagonal{Float64}) == 2
838
+ @test ndims(Diagonal) == 2
839
+ @test ndims(Vector) == 1
840
+ @test ndims(Matrix) == 2
841
+ @test ndims(Array{<:Any, 0}) == 0
842
+ @test_throws MethodError ndims(Array)
843
end
844
845
@testset "Issue #17811" begin
0 commit comments