diff --git a/src/MachO/MachOFat.jl b/src/MachO/MachOFat.jl index b636f21..68efcf9 100644 --- a/src/MachO/MachOFat.jl +++ b/src/MachO/MachOFat.jl @@ -67,7 +67,7 @@ keys(h::FatMachOHandle) = 1:length(h) iterate(h::FatMachOHandle, idx=1) = idx > length(h) ? nothing : (h[idx], idx+1) lastindex(h::FatMachOHandle) = lastindex(h.header.archs) length(h::FatMachOHandle) = length(h.header.archs) -eltype(::Type{S}) where {S <: FatMachOHandle} = MachOLoadCmdRef +eltype(::Type{<:FatMachOHandle}) = MachOHandle function getindex(h::FatMachOHandle, idx) seek(h.io, h.start + h.header.archs[idx].offset) only(readmeta(h.io, MachOHandle)) diff --git a/test/runtests.jl b/test/runtests.jl index ba88082..d67c56e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -204,6 +204,10 @@ function test_fat_libfoo(file) end @test ntotal == 2 @test n64 == 1 + + handles = collect(ohs) + @test handles isa Vector{<:MachOHandle} + @test length(handles) == 2 end function test_metal(file)