Skip to content

call signature with free type variable can corrupt the dispatch cache #49027

Open
@KristofferC

Description

@KristofferC

MWE:

using SciMLBase

function check_isdefined(::Type{<:SciMLBase.IntervalNonlinearFunction{iip}}) where {iip}
    @show @isdefined iip
    if @isdefined iip
        @show iip
    end
end

dt2 = IntervalNonlinearFunction{TypeVar(:iip)}

check_isdefined(dt2)

On bad Julia versions this gives

#= /home/kristofferc/julia/bisect.jl:9 =# @isdefined(iip) = true
ERROR: LoadError: UndefVarError: `iip` not defined

On good ones

#= /home/kristofferc/julia/bisect.jl:9 =# @isdefined(iip) = false

Bisected to #46791 (which was backported). cc @aviatesk

Xref: #35661

Metadata

Metadata

Assignees

Labels

types 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