timholy / timholy/MethodAnalysis.jl
Incorrect dispatch on `Base.Callable`
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 97
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
This was surfaced in https://discourse.julialang.org/t/how-do-i-precompile-a-callable-struct/115037/5, this package is assuming that only subtypes of Base.Callable have methods, but that's not true.
julia> struct Foo end
julia> (::Foo)() = 1
julia> Foo()()
1
julia> Foo() isa Base.Callable
false
julia> methodinstances((Foo(),))
Core.MethodInstance[]
versus
julia> struct Bar <: Function end
julia> (::Bar)() = 1
julia> Bar()()
1
julia> methodinstances((Bar(),))
1-element Vector{Core.MethodInstance}:
MethodInstance for (::Bar)()
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Julia reproducer in the issue and trace the package's handling of methodinstances and Base.Callable. Verify the behavior for callable structs that do and do not subtype Function, then confirm that both cases are dispatched and analyzed correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100