Which shows that the macro generates full_cache(var"#329#c"::OrdinaryDiffEq.RK_ALGCache), with RK_ALGCache defined in the OrdinaryDiffEq namespace, and not in Main (where the example is run), leading to the UndefVarError.
Yeah this came up in the refactor PRs. I'm not entirely sure what's causing this behavior but after the refactor I plan to figure out what's going on here.
Describe the bug π
@cache
macro generates code with OrdinaryDiffEq namespace.Expected behavior
No error on using
@cache
on our own structs.Minimal Reproducible Example π Following the documentation on adding algorithms, we run:
Error & Stacktrace β οΈ
Which produces the following error:
Additional context
Macroexpand to the rescue:
Which shows that the macro generates
full_cache(var"#329#c"::OrdinaryDiffEq.RK_ALGCache)
, withRK_ALGCache
defined in theOrdinaryDiffEq
namespace, and not inMain
(where the example is run), leading to theUndefVarError
.