CodeTracking.jl icon indicating copy to clipboard operation
CodeTracking.jl copied to clipboard

Does not handle anonymous functions defined within other functions

Open Socob opened this issue 5 months ago • 0 comments

See title. When trying to get the definition of such a function (e. g. the return value of get_anon() = x -> x^3 + 777), there is a warning and the result is nothing.


File tmp.jl:

get_anon() = x -> x^3 + 777
anon = get_anon()

REPL:

julia> using Revise

julia> using CodeTracking

julia> includet("tmp.jl")

julia> @code_expr anon(10)
┌ Warning: Tuple{var"#1#2", Any} was not found
└ @ Revise ~/.julia/packages/Revise/uvGMC/src/packagedef.jl:1112

julia> definition(Expr, which(anon, Base.typesof(10)))
┌ Warning: Tuple{var"#1#2", Any} was not found
└ @ Revise ~/.julia/packages/Revise/uvGMC/src/packagedef.jl:1112

Socob avatar Sep 17 '24 15:09 Socob