Selective import seems to be importing more than just specified symbol

Steven Schveighoffer schveiguy at gmail.com
Thu Jan 9 05:32:35 UTC 2025


On Wednesday, 8 January 2025 at 02:07:46 UTC, WhatMeWorry wrote:

> I thought that the line
> import honeycomb : Location;
> would only import the symbol struct Location?

So imagine a `honeycomb.d` file that looks like this:

```d
module honeycomb;

import std.stdio;

struct Location {
     int r;
     int c;
     File foo;
}
```

A nonsense file, but I hope you can see that the compiler has to 
still process the file and analyze it even if you don't use all 
of it.

-Steve


More information about the Digitalmars-d-learn mailing list