I have code that works when I execute it in the REPL
and when I use the julia
command from the command line directly.
However, when I run the debugger on an attempted dispatch the debugger crashes with:
┌ Error: Some Julia code in the VS Code extension crashed
└ @ VSCodeDebugger ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/error_handler.jl:15
ERROR: MethodError: no method matching namemap(::Type{Hermes.ResourceLocation})
The applicable method may be too new: running in world age 32424, while current world is 32462.
Closest candidates are:
namemap(::Type{Hermes.ResourceLocation}) at Enums.jl:201 (method too new to be called from this world context.)
namemap(::Type{Pkg.GitTools.GitMode}) at Enums.jl:201
namemap(::Type{OpenSSL.BIOCtrl}) at Enums.jl:201 (method too new to be called from this world context.)
...
Stacktrace:
[1] _symbol(x::Hermes.ResourceLocation)
@ Base.Enums ./Enums.jl:29
[2] show(io::IOBuffer, x::Hermes.ResourceLocation)
@ Base.Enums ./Enums.jl:37
[3] show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar})
@ Base ./show.jl:638
[4] show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar})
@ Base ./show.jl:1011
[5] show_datatype
@ ./show.jl:989 [inlined]
[6] _show_type(io::IOBuffer, x::Type)
@ Base ./show.jl:889
[7] show(io::IOBuffer, x::Type)
@ Base ./show.jl:881
[8] print(io::IOBuffer, x::Type)
@ Base ./strings/io.jl:35
[9] print_to_string(xs::Type)
@ Base ./strings/io.jl:144
[10] string
@ ./strings/io.jl:185 [inlined]
[11] construct_return_msg_for_var(state::VSCodeDebugger.DebugAdapter.DebuggerState, name::String, value::
I have not been able to create a small replicable example despite mirroring the basic structure of where the error occurs in the more complicated code base.
But basically here are relevant parts of my code:
@enum ResourceLocation::UInt8 cached remote
determine_resource_location(loader::TardisLoader) = begin
possible_cached_path = create_resource_path(loader, Val(cached))
isfile(possible_cached_path) ? cached : remote
end
fetch_resource(loader::TardisLoader) = begin
resource_location = determine_resource_location(loader)
ERROR ---> resource = fetch_resource(loader, Val(resource_location))
...
end
fetch_resource(loader::TardisLoader, location_value_type::Val{remote}) = begin
...
end
fetch_resource(loader::TardisLoader, location_value_type::Val{cached}) = begin
...
end
The error occurs when I step into the function call that I marked above with ERROR --->
. If I step over it the debugger is able to continue normally.
Any ideas on what is going on here? Is there something wrong on my part, or something wrong on the VSCode/Debugger part?