[PATCH 1/2] [D] Don't recursively look for a symbol in all imports of imported modules.
Consider the following pathological case:
import B, C;
When looking up a symbol in module 'B' from module 'A', although it
won't lead to infinite recursion, it will cause a to and fro to occur
between the two cyclic imports. This get exponentially worse when
there are tens or hundreds of modules all importing each other.
Although there is a genuine case to recursively search imports from
foreign modules, this only makes sense in D for 'public' imports,
which would be expressed as:
public import C; // All symbols in 'C' are available to any module
that imports 'B'
However there is no way to detect this as of today in DWARFv4. Only
DW_TAG_imported_declarations get a DW_AT_accessibility attribute.
Though perhaps DW_AT_visibility would be more accurate because 'static
import' would be considered as qualified.
But I digress on matters outside the scope of this patch. :-)