Skip to content

Commit 2747e82

Browse files
authored
define propertynames(::FixedSizeArray) (#73)
Make both fields private.
1 parent 7d9f5d5 commit 2747e82

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/FixedSizeArrays.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ struct FixedSizeArray{T,N,Mem<:GenericMemory{<:Any,T}} <: DenseArray{T,N}
1919
end
2020
end
2121

22+
function Base.propertynames(
23+
# the `unused` is here because of https://github.com/JuliaLang/julia/issues/44428
24+
(@nospecialize unused::FixedSizeArray),
25+
::Bool = false,
26+
)
27+
()
28+
end
29+
2230
const FixedSizeVector{T} = FixedSizeArray{T,1}
2331
const FixedSizeMatrix{T} = FixedSizeArray{T,2}
2432

test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ end
125125
FSM = fsm(storage_type)
126126
FSA = fsa(storage_type)
127127

128+
@testset "`propertynames`" begin
129+
for dim_count 0:4
130+
for T (Int, Float32)
131+
siz = ntuple(Returns(1), dim_count)
132+
arr = FSA{T}(undef, siz)
133+
test_inferred(propertynames, Tuple{}, (arr,))
134+
test_inferred(propertynames, Tuple{}, (arr, false))
135+
end
136+
end
137+
end
138+
128139
@testset "Constructors" begin
129140
for dim_count 0:4
130141
siz = ntuple(Returns(2), dim_count)

0 commit comments

Comments
 (0)