Our compile time tracking is based on lexical information and not runtime tracing. So if you hide the module by dynamically generating it, then incremental compilation won’t be applied.
It is not dynamically generated, it is generated in compile time
Things like alias and require as are still tracked though
Things from macro expansion are tracked too
In this example,
YYY
defmodule XXX do
...
end
Recompiling when YYY changed causes XXX to be recompiled too.
So, I am guessing that after every macro expansion and unaliasing, compiler just takes all atoms starting with Elixir. from external context and module body (but not from def*) and marks current module dependent from them, right?