JuliaDebug / JuliaDebug/Cthulhu.jl

Errors with TypedSyntax

Open
#653 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
709
Forks
46
Avg merge
1d 13h
Merged PRs (30d)
2

Description

On multiple Julia versions I get errors with Cthulhu just trying to call @descend

ERROR: UndefVarError: `child` not defined in `TypedSyntax`
Suggestion: this global was defined as `JuliaSyntax.child` but not assigned a value.
Stacktrace:
  [1] collect_symbol_nodes(rootnode::JuliaSyntax.SyntaxNode)
    @ TypedSyntax ~/.julia/packages/TypedSyntax/eS4sW/src/node.jl:417
  [2] map_ssas_to_source(src::Core.CodeInfo, mi::Core.MethodInstance, rootnode::JuliaSyntax.SyntaxNode, Δline::Int64)
    @ TypedSyntax ~/.julia/packages/TypedSyntax/eS4sW/src/node.jl:529
  [3] map_ssas_to_source
    @ ~/.julia/packages/TypedSyntax/eS4sW/src/node.jl:868 [inlined]
  [4] tsn_and_mappings(mi::Core.MethodInstance, src::Core.CodeInfo, rt::Any, sourcetext::SubString{String}, lineno::Int32; warn::Bool, strip_macros::Bool, kwargs::@Kwargs{})
    @ TypedSyntax ~/.julia/packages/TypedSyntax/eS4sW/src/node.jl:54
  [5] tsn_and_mappings(mi::Core.MethodInstance, src::Core.CodeInfo, rt::Any; warn::Bool, strip_macros::Bool, kwargs::@Kwargs{})
    @ TypedSyntax ~/.julia/packages/TypedSyntax/eS4sW/src/node.jl:39
  [6] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/reflection.jl:358
  [7] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/reflection.jl:357
  [8] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/reflection.jl:27
  [9] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:381
 [10] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:289
 [11] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:672
 [12] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:672
 [13] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:683
 [14] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:680
 [15] __descend_with_error_handling(args::Any; terminal::Any, kwargs...)
    @ Cthulhu ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:133
 [16] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:122
 [17] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:114
 [18] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:151
 [19] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/CthulhuBase.jl:151
 [20] descend(::Any, ::Vararg{Any}; kwargs...)
    @ Cthulhu ~/.julia/packages/Cthulhu/dkzKO/src/Cthulhu.jl:111
 [21] top-level scope
    @ ~/.julia/packages/Cthulhu/dkzKO/src/Cthulhu.jl:110
 [22] top-level scope
    @ REPL[14]:1

I'm not sure how to diagnose this since it's an stdlib involved and I do see a child global available in JuliaSyntax

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

Reproduce the failure by calling @descend across the affected Julia versions, then inspect TypedSyntax's node.jl around lines 417 and 529 and Cthulhu's reflection.jl around lines 357-358. Determine why JuliaSyntax.child is unavailable in this path; done means @descend no longer raises the reported UndefVarError.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.