Error: Undefined variable, inside a macro in a for loop in a function of a module

@benchmark operates at global scope, so you need to use $ to interpolate any local values. This is kind of a quirk of BenchmarkTools in particular, and you’re far from the first person to run into it. In your case, this would look like @benchmark FDEsolve($F, $tSpan, ....).

More info here: Manual · BenchmarkTools.jl