Skip to content

Dispatch error in v1.12 #58479

Closed
Closed
@JonasIsensee

Description

@JonasIsensee

Hi,

this popped up in JLD2 JuliaIO/JLD2.jl#645.

using JLD2 # v0.5.13
struct Foo end
which(JLD2.h5fieldtype, Tuple{JLD2.JLDFile{JLD2.MmapIO}, Type{Type{Foo}}, Type{Type{Foo}}, Type{Val{false}}})

On v1.11 and earlier this gives:

h5fieldtype(f::JLD2.JLDFile, ::Type{T}, readas::Type, ::Union{Type{Val{true}}, Type{Val{false}}}) where T<:DataType
     @ JLD2 /data.lmp/isensee/.julia/dev/JLD2/src/data/writing_datatypes.jl:382

On v1.12:

h5fieldtype(f::JLD2.JLDFile, writeas, readas::Type, initialized::Union{Type{Val{true}}, Type{Val{false}}})
     @ JLD2 /data.lmp/isensee/.julia/dev/JLD2/src/data/writing_datatypes.jl:91

The method in line 382 still exists but cannot be dispatched to
When removing the definition in line 91, I get an error: (pasted as image for colors)

Image

Oddly enough: When tested in isolation, this works just fine.

julia> testfun(::JLD2.JLDFile, writeas::Type{T}, readas::Type, initialized::JLD2.Initialized) where T<:DataType = "works"
testfun (generic function with 1 method)

julia> which(testfun, Tuple{JLD2.JLDFile{JLD2.MmapIO}, Type{Type{Foo}}, Type{Type{Foo}}, Type{Val{false}}})
testfun(::JLD2.JLDFile, writeas::Type{T}, readas::Type, initialized::Union{Type{Val{true}}, Type{Val{false}}}) where T<:DataType
     @ Main REPL[22]:1

Metadata

Metadata

Assignees

Labels

regressionRegression in behavior compared to a previous versionregression 1.12Regression in the 1.12 releasetypes and dispatchTypes, subtyping and method dispatch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions