Circular dependencies in Phobos

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 3 10:41:39 PST 2016


On Sunday, 3 January 2016 at 17:34:19 UTC, Jakob Ovrum wrote:
> On Sunday, 3 January 2016 at 17:31:41 UTC, Jakob Ovrum wrote:
>> On Sunday, 3 January 2016 at 17:25:40 UTC, tsbockman wrote:
>>> On Sunday, 3 January 2016 at 17:18:05 UTC, Jakob Ovrum wrote:
>>>> Yes, but it shouldn't be designed around a bug.
>>>
>>> Unless the bug is actually going to be fixed some time soon, 
>>> why would I deliberately design something in a way that is 
>>> broken? Does it really matter *why* it is broken?
>>
>> So, we're talking about a library using CheckedInt. If the 
>> library selectively imports anything from CheckedInt at 
>> module-level, it'll always be public due to a bug.
>>
>> This is trivial to work around. Often the import can be 
>> nested, and when it can't, a static import or renamed module 
>> import can be used to resolve conflicts.
>>
>> It's not a big deal.
>
> Apparently the bug affects static imports and renamed module 
> imports too. Bleh.

Yes visibility control for the import system is pretty badly 
broken right now. I'm surprised this still hasn't been fixed 
after so long; I guess it must be really tricky for some reason.

Anyway, my submodule setup is motivated as much by the desire not 
to be forced to make long lists of every symbol I import, as it 
is by the need to work around that bug. If it was left up to me, 
my scheme wouldn't change that much even if the bug were fixed 
tomorrow.


More information about the Digitalmars-d mailing list