SciML / OrdinaryDiffEq.jl

High performance ordinary differential equation (ODE) and differential-algebraic equation (DAE) solvers, including neural ordinary differential equations (neural ODEs) and scientific machine learning (SciML)
https://diffeq.sciml.ai/latest/
Other
536 stars 205 forks source link

Fix unescaped name argument in cache macro. #2257

Closed evetion closed 3 months ago

evetion commented 3 months ago

Fixes https://github.com/SciML/OrdinaryDiffEq.jl/issues/2158

Checklist

Additional context

As discussed in the linked issue, the @cache macro generated the line full_cache(var"#329#c"::OrdinaryDiffEq.RK_ALGCache) = begin, specifically namespacing RK_ALGCache (leading to ERROR: UndefVarError:RK_ALGCachenot defined), because RK_ALGCache was defined elsewhere (Main in this case). This is fixed by escaping the name of the struct.

I also removed a perfect duplicate cache macro (and added an import) in the lib/OrdinaryDiffEqExtrapolation code, possibly put there because the original macro didn't work?