JuliaDebug / JuliaDebug/Cthulhu.jl

can't descend into opaque closures

Open
#162 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted julia features
Dominant language
Julia
Stars
709
Forks
46
Avg merge
1d 13h
Merged PRs (30d)
2

Description

For example:

julia> descend(Base.Experimental.@opaque(() -> 1), Tuple{})
ERROR: no unique matching method found for the specified argument types
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] _which
    @ ./reflection.jl:1304 [inlined]
  [3] _which(tt::Type)
    @ Base ./reflection.jl:1298
  [4] get_specialization(TT::Any)
    @ Cthulhu ~/.julia/packages/Cthulhu/xWxSl/src/Cthulhu.jl:380
  [5] get_specialization(F::Any, TT::Any)
    @ Cthulhu ~/.julia/packages/Cthulhu/xWxSl/src/Cthulhu.jl:386
  [6] mkinterp(::Any, ::Vararg{Any})
    @ Cthulhu ~/.julia/packages/Cthulhu/xWxSl/src/Cthulhu.jl:391
  [7] _descend(::Any, ::Vararg{Any}; params::Core.Compiler.NativeInterpreter, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:iswarn,), Tuple{Bool}}})
    @ Cthulhu ~/.julia/packages/Cthulhu/xWxSl/src/Cthulhu.jl:397
  [8] _descend_with_error_handling(::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
    @ Cthulhu ~/.julia/packages/Cthulhu/xWxSl/src/Cthulhu.jl:134
  [9] #descend_code_typed#47
    @ ~/.julia/packages/Cthulhu/xWxSl/src/Cthulhu.jl:106 [inlined]
 [10] descend_code_typed(f::Function, tt::Any)
    @ Cthulhu ~/.julia/packages/Cthulhu/xWxSl/src/Cthulhu.jl:106
 [11] top-level scope
    @ REPL[51]:1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with get_specialization and mkinterp in Cthulhu.jl around lines 380–391, then reproduce the opaque-closure call shown in the issue. Trace the _which failure for the opaque closure; done means descend(...) no longer errors for this example and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
compilers, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.