Suggestion for DUB users: The vanity package

Paul Backus snarwin at gmail.com
Wed Oct 20 18:40:41 UTC 2021


On Wednesday, 20 October 2021 at 13:39:22 UTC, Steven 
Schveighoffer wrote:
> e.g. try to name a function `std`, then import `std.stdio`. You 
> will get a failure.
>
> Whereas if you name your function `stdio`, then everything 
> works fine.

Huh. Yep, it sure does:

```d
import std.stdio;

// Error: variable `onlineapp.std` conflicts with import 
`onlineapp.std` at onlineapp.d(1)
int std;

void main()
{
     writeln("Hello world!");
}
```

Honestly I would classify this as a straight-up bug. According to 
the spec on [Symbol Name Lookups][1], this program should work 
fine.

[1]: https://dlang.org/spec/module.html#name_lookup


More information about the Digitalmars-d mailing list