However, sadly, it does not work.
┌ Debug: 2020-03-06 14:38:53 Precompiling Stipple [c3245d6e-4e41-4672-accb-64620d5e5a71]
└ @ Base loading.jl:1273
WARNING: eval into closed module Html:
Expr(:function, :stylesheet)
** incremental compilation may be fatally broken for this module **
And then Julia segfaults:
signal (11): Segmentation fault: 11
This is the offending code:
Core.eval(Genie.Renderer.Html, :(function stylesheet end))
function Genie.Renderer.Html.stylesheet(href::String; args...) :: String
Genie.Renderer.Html.link(href=href, rel="stylesheet", args...)
end
Running various tests seems to confirm that the first part is successful (defining the function) but the second (specializing the function) causes Julia to crash. This behaviour was consistent throughout all my tests (always segfaults).
Leaving just the eval and running the function specialization code from the REPL works fine.
Update 1:
Extracting away just the code, out of the package I’m developing into a minimal test file, works fine. So some combination of factors causes the segfault.