Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ambiguous methods #606

Closed
dpinol opened this issue Oct 7, 2024 · 3 comments
Closed

fix ambiguous methods #606

dpinol opened this issue Oct 7, 2024 · 3 comments
Labels

Comments

@dpinol
Copy link
Contributor

dpinol commented Oct 7, 2024

using JLD2, Test

julia> a=detect_ambiguities(JLD2; recursive=true)
12-element Vector{Tuple{Method, Method}}:
 (jlconvert(::JLD2.ReadRepresentation{T, JLD2.CustomSerialization{S, ODR}}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T, S, ODR} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/custom_serialization.jl:63, jlconvert(::JLD2.ReadRepresentation{T, T}, ::JLD2.JLDFile, ptr::Ptr, ::JLD2.RelOffset) where T @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/writing_datatypes.jl:302)
 (jlconvert(::JLD2.ReadRepresentation{T, JLD2.CustomSerialization{S, JLD2.RelOffset}}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/custom_serialization.jl:55, jlconvert(::JLD2.ReadRepresentation{T, T}, ::JLD2.JLDFile, ptr::Ptr, ::JLD2.RelOffset) where T @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/writing_datatypes.jl:302)
 (read(io::JLD2.RWBuffer, T::Union{Type{Float16}, Type{Float32}, Type{Float64}, Type{Int128}, Type{Int16}, Type{Int32}, Type{Int64}, Type{Int8}, Type{UInt128}, Type{UInt16}, Type{UInt32}, Type{UInt64}, Type{UInt8}}) @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/io/io_wrappers.jl:145, read(s::IO, T::Union{Type{Float16}, Type{Float32}, Type{Float64}, Type{Int128}, Type{Int16}, Type{Int32}, Type{Int64}, Type{UInt128}, Type{UInt16}, Type{UInt32}, Type{UInt64}}) @ Base io.jl:903)
 (write_header_message(io, f, msg::Pair{String, JLD2.RelOffset}) @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/explicit_datasets.jl:239, write_header_message(io, vtype::Val{HMT}, hflags; ...) where HMT @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/object_headers.jl:25)
 (jlconvert(::JLD2.ReadRepresentation{T, S}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T<:ReconstructedMutable, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/reconstructing_datatypes.jl:635, jlconvert(::JLD2.ReadRepresentation{T, JLD2.Vlen{S}}, f::JLD2.JLDFile, ptr::Ptr, ::JLD2.RelOffset) where {T, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/writing_datatypes.jl:367)
 (write_header_message(io, f, msg::Pair{String, JLD2.RelOffset}, ::Any) @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/explicit_datasets.jl:239, write_header_message(io, vtype::Val{HMT}, hflags, size; kwargs...) where HMT @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/object_headers.jl:25)
 (jlconvert(::JLD2.ReadRepresentation{T, T}, ::JLD2.JLDFile, ptr::Ptr, ::JLD2.RelOffset) where T @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/writing_datatypes.jl:302, jlconvert(::JLD2.ReadRepresentation{T, JLD2.Vlen{S}}, f::JLD2.JLDFile, ptr::Ptr, ::JLD2.RelOffset) where {T, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/writing_datatypes.jl:367)
 (jlconvert(::JLD2.ReadRepresentation{T, S}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T<:ReconstructedMutable, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/reconstructing_datatypes.jl:635, jlconvert(::JLD2.ReadRepresentation{T, T}, ::JLD2.JLDFile, ptr::Ptr, ::JLD2.RelOffset) where T @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/writing_datatypes.jl:302)
 (jlconvert(::JLD2.ReadRepresentation{T, JLD2.CustomSerialization{S, ODR}}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T, S, ODR} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/custom_serialization.jl:63, jlconvert(::JLD2.ReadRepresentation{T, S}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T<:ReconstructedMutable, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/reconstructing_datatypes.jl:635)
 (jlconvert(::JLD2.ReadRepresentation{T, JLD2.CustomSerialization{S, JLD2.RelOffset}}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/custom_serialization.jl:55, jlconvert(::JLD2.ReadRepresentation{T, S}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T<:ReconstructedMutable, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/reconstructing_datatypes.jl:635)
 (jlconvert(::JLD2.ReadRepresentation{T, S}, f::JLD2.JLDFile, ptr::Ptr, header_offset::JLD2.RelOffset) where {T<:ReconstructedMutable, S} @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/reconstructing_datatypes.jl:635, jlconvert(::JLD2.ReadRepresentation{T, JLD2.RelOffset}, f::JLD2.JLDFile, ptr::Ptr, ::JLD2.RelOffset) where T @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/data/writing_datatypes.jl:338)
 (read(io::JLD2.RWBuffer, T::Union{Type{Float16}, Type{Float32}, Type{Float64}, Type{Int128}, Type{Int16}, Type{Int32}, Type{Int64}, Type{Int8}, Type{UInt128}, Type{UInt16}, Type{UInt32}, Type{UInt64}, Type{UInt8}}) @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/io/io_wrappers.jl:145, read(s::IO, ::Type{Int8}) @ Base io.jl:902)

btw, the following 2 only appear after 0.5.5 (and are the only ones reported when I run detect_ambiguities against my package 🤷 )

 (read(io::JLD2.RWBuffer, T::Union{Type{Float16}, Type{Float32}, Type{Float64}, Type{Int128}, Type{Int16}, Type{Int32}, Type{Int64}, Type{Int8}, Type{UInt128}, Type{UInt16}, Type{UInt32}, Type{UInt64}, Type{UInt8}}) @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/io/io_wrappers.jl:145, read(s::IO, T::Union{Type{Float16}, Type{Float32}, Type{Float64}, Type{Int128}, 

 (read(io::JLD2.RWBuffer, T::Union{Type{Float16}, Type{Float32}, Type{Float64}, Type{Int128}, Type{Int16}, Type{Int32}, Type{Int64}, Type{Int8}, Type{UInt128}, Type{UInt16}, Type{UInt32}, Type{UInt64}, Type{UInt8}}) @ JLD2 ~/.julia/packages/JLD2/3zWRM/src/io/io_wrappers.jl:145, read(s::IO, ::Type{Int8}) @ Base io.jl:902)
@JonasIsensee
Copy link
Collaborator

Hi @dpinol,
thanks for pointing this out.
I know about all the old ambiguities. They are irrelevant since the ambiguity will never appear at runtime. (requires manually constructed and malformed internal types.

The others should be fixed!

@JonasIsensee JonasIsensee mentioned this issue Oct 18, 2024
@JonasIsensee
Copy link
Collaborator

I just tagged v0.5.6 that removes the ambiguities and adds aqua tests to prevent regressions

@dpinol
Copy link
Contributor Author

dpinol commented Oct 19, 2024

thanks 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants