When you get a circular dependency error, you receive a printout of the cycle for the dependencies, something like:
a->b->c->a
which shows the import graph of why the cycle occurred.
However, this doesn't tell you how each dependency was imported. The compiler could easily store the file/line that caused an import to be added as a dependency, which would further help identify how the cycle happened.
Sometimes, when instantiating a template, you have an import you don't even see in a module. So knowing that a imported b because a template in x had an import of b, and a instantiated that template would go a long way to lower confusion.
This might not be something to do in normal builds, but maybe in debug builds? Or maybe with a switch to store extra dependency info?
Comment #1 by robert.schadek — 2024-12-13T19:27:07Z