On Wednesday, 19 August 2015 at 23:18:04 UTC, Timon Gehr wrote:
On 08/20/2015 01:06 AM, Dicebot wrote:
On Wednesday, 19 August 2015 at 22:33:23 UTC, Timon Gehr wrote:
It's a bug in local imports. This is the ticket:
https://issues.dlang.org/show_bug.cgi?id=10378
Seems to fit into existing shadowing semantics.
There's no precedent for symbols shadowed by imports.
If this is a bug we may need a new spec.
I believe local imports were first implemented without paying
any attention to shadowing. I think the broken semantics
implemented in DMD without a sufficient up-front design were
then back-ported into the documentation at some point. This
still happens too often. This is the JavaScript style of
language design.
import should NEVER shadow local symbols.