Closed
Description
Consider:
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__
andsource.__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 matchingenable_thunk()
to restore original definition
Metadata
Metadata
Assignees
Labels
No labels