You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> extern(foo())
ERROR: ArgumentError: invalid rational: zero(Int64)//zero(Int64)
Stacktrace:
[1] __throw_rational_argerror(::Type) at ./rational.jl:19
[2] Rational at ./rational.jl:14 [inlined]
[3] Rational at ./rational.jl:21 [inlined]
[4] //(::Int64, ::Int64) at ./rational.jl:44
[5] (::var"#13#14")() at /Users/oxinabox/.julia/packages/ChainRulesCore/LC8Sv/src/differentials.jl:243
[6] (::Thunk{var"#13#14"})() at /Users/oxinabox/.julia/packages/ChainRulesCore/LC8Sv/src/differentials.jl:250
[7] extern(::Thunk{var"#13#14"}) at /Users/oxinabox/.julia/packages/ChainRulesCore/LC8Sv/src/differentials.jl:251
[8] top-level scope at REPL[9]:1
There was an error thrown within the thunk.
but the stacktrace tells me nothing about how to find the thunk.
It doesn't tell me wher the Thunk was, nor what it contained.
There are a few things we can investigate:
(somehow) make it so the line numbers for the thunk's inner function in [5] reflect where the @thunk was rather than its contents
use source.__line__ and source.__file__ to actually include that in the functions name
include the expression wrapped in the functions name
Have a way to disable thiunking and make it eager. I think this can be done by having disable_thunking()=@eval macro thunk(x) x end and matching enable_thunk() to restore original definition
The text was updated successfully, but these errors were encountered:
julia> macro demo()
Expr(:->, Expr(:tuple), Expr(:block, __source__, Expr(:call, +, 1, 1)))
end
@demo (macro with 1 method)
julia> f = @demo
#7 (generic function with 1 method)
julia> methods(f)
# 1 method for anonymous function "#7":
[1] (::var"#7#8")() in Main at REPL[2]:1
julia> g=@demo
#9 (generic function with 1 method)
julia> methods(g)
# 1 method for anonymous function "#9":
[1] (::var"#9#10")() in Main at REPL[4]:1
Note that f says it was declared in REPL cell 2,
and g says that it was declared in REPL cell 4.
Consider:
There was an error thrown within the thunk.
but the stacktrace tells me nothing about how to find the thunk.
It doesn't tell me wher the Thunk was, nor what it contained.
There are a few things we can investigate:
[5]
reflect where the@thunk
was rather than its contentssource.__line__
andsource.__file__
to actually include that in the functions namedisable_thunking()=@eval macro thunk(x) x end
and matchingenable_thunk()
to restore original definitionThe text was updated successfully, but these errors were encountered: