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).
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to