Skip to content

Commit 01fc2b9

Browse files
committed
Fix eltype for FatMachOHandle
1 parent 179033c commit 01fc2b9

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/MachO/MachOFat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ keys(h::FatMachOHandle) = 1:length(h)
6767
iterate(h::FatMachOHandle, idx=1) = idx > length(h) ? nothing : (h[idx], idx+1)
6868
lastindex(h::FatMachOHandle) = lastindex(h.header.archs)
6969
length(h::FatMachOHandle) = length(h.header.archs)
70-
eltype(::Type{S}) where {S <: FatMachOHandle} = MachOLoadCmdRef
70+
eltype(::Type{<:FatMachOHandle}) = MachOHandle
7171
function getindex(h::FatMachOHandle, idx)
7272
seek(h.io, h.start + h.header.archs[idx].offset)
7373
only(readmeta(h.io, MachOHandle))

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ function test_fat_libfoo(file)
204204
end
205205
@test ntotal == 2
206206
@test n64 == 1
207+
208+
handles = collect(ohs)
209+
@test handles isa Vector{<:MachOHandle}
210+
@test length(handles) == 2
207211
end
208212

209213
function test_metal(file)

0 commit comments

Comments
 (0)