[dmd-beta] dmd 2.063 beta 3

Walter Bright walter at digitalmars.com
Sat May 18 13:37:41 PDT 2013


On 5/18/2013 1:30 PM, Rainer Schuetze wrote:
>
> I think the new behaviour is consistent with symbol lookup rules, but I'm not 
> so sure about import rules. The actual case that triggered the issue was with 
> the base class in a different file. Usually non-public imports in a module 
> don't have an effect on another module that imports the module. In this case 
> it has.
>
> Actually, I can live with it, but I cannot see a reasonable use case for the 
> new behaviour. My rule of thumb would be to not use local import in classes. 
> Otherwise all imported symbols are treated as static members with respect to 
> lookup, hiding global functions or variables in derived classes.


The current behavior is consistent with the D lookup and scoping rules. I 
believe it is better to have a consistent rule than one that has a lot of 
arbitrary cases in order to be more intuitive - my experience with that is 
people never to figure out what those arbitrary rules are, they just poke at 
random until it works (see C++ overloading rules for a fine example).


More information about the dmd-beta mailing list