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.
last
1 parent 27a6df7 commit 2bd8fb8Copy full SHA for 2bd8fb8
src/ZeroDimensionalArrays.jl
@@ -75,6 +75,10 @@ function Base.only(a::ZeroDimensionalArray)
75
a[]
76
end
77
78
+function Base.last(a::ZeroDimensionalArray)
79
+ a[]
80
+end
81
+
82
function Base.iterate(a::ZeroDimensionalArray)
83
(a[], nothing)
84
test/runtests.jl
@@ -23,6 +23,7 @@ using Aqua: Aqua
23
@test (@inferred convert(Arr{Float32}, fill(x))) isa Arr{Float32}
24
@test () === @inferred propertynames(Arr(x))
25
@test only(fill(x)) === @inferred only(Arr(x))
26
+ @test last(fill(x)) === @inferred last(Arr(x))
27
@test fill(x)[] === @inferred Arr(x)[]
28
@test fill(x)[1] === @inferred Arr(x)[1]
29
@test @inferred isassigned(Arr(x))
0 commit comments