I don’t know why, but sometimes the precompilation produces strange results. Typically, a recompilation due to invalidation will fix the problem (even if there is essentially no change in the code). The technique of deleting the “*.ji” file will not change the result, as it will re-run the problematic precompilation.
(see the comment below for an example)
So, is there a way to prompt for a recompilation of specific methods?
Not sure if this answers your question, but if you are using Revise.jl you can ask it to check changes and recompile a whole Module. But you may as well be having some age-of-the-world problems.
Yes, I’m using Revise.jl for development, and applying the mechanism that Revise.jl uses may help me achieve my goal. However, it would be going too far into Julia’s internals.
I would like to suggest a workaround to users of packages (e.g. Colors.jl, which has been having the precompilation problem for over a year).
If I understand correctly, you could always use precompile on your required method signatures
help?> precompile
search: precompile __precompile__
precompile(f, args::Tuple{Vararg{Any}})
Compile the given function f for the argument tuple (of types) args, but do not execute it.