tl;dr: imports could reduce a lot of their overhead if the compiler would resolve symbols only when required.
foo.d
---
struct Foo
{
import mybigfilewithlotsofctfe;
}
struct Bar;
---
test.d
----
void main()
{
import foo;
Bar b;
}
---
Ideally the compiler wouldn't even look at Foo and thus not open `mybigfilewithlotsofctfe`.
Note that this is already done if `struct Foo` is a template.
Comment #1 by robert.schadek — 2024-12-13T18:56:59Z