Grouped named import

Quirin Schroll qs.il.paperinik at gmail.com
Tue Jul 23 11:08:54 UTC 2024


On Monday, 22 July 2024 at 12:49:29 UTC, ryuukk_ wrote:
> On Monday, 22 July 2024 at 12:47:34 UTC, ryuukk_ wrote:
>> On Monday, 22 July 2024 at 12:29:24 UTC, Quirin Schroll wrote:
>>> I just realized one can do this:
>>> ```d
>>> import x = std.stdio;
>>> import x = std.file;
>>> ```
>>>
>>> If that is intended, it’s especially important for clarity 
>>> that separate import statements are required.
>>
>> I didn't know it was possible, that's good to know, no need 
>> for that DIP then, case is closed, thanks!
>
> I just tested, it doesn't work...
>
>
> `onlineapp.d(2): Error: import `onlineapp.x` conflicts with 
> import `onlineapp.x` at onlineapp.d(1)`

It doesn’t work for module-scope imports, as you point out, but 
it’s not diagnosed for function-scope imports. [Filed a 
bug.](https://issues.dlang.org/show_bug.cgi?id=24672)


More information about the dip.ideas mailing list