[dmd-beta] D2 2.058 beta

Martin Nowak dawg at dawgfoto.de
Sat Feb 11 08:17:48 PST 2012


Actually it's much worse than I thought.
We used to add aliases for selective imports, renamed imports and  
module/package names.
But now they are handled by Import::search, i.e. after searching in the  
current
scope has failed.
This causes a lot of regressions.

The old alias mechanism was fine, it only lacked the necessary access  
checks.
I'm working on a purge now. We'd better reconsider this after fixing  
access checks
during the next release.

-------------
#!/bin/sh
export DMD=dmd2.057
#export DMD=dmd2.058beta

echo ===== Regression 1 - Selective imports are not checked =====
cat > a.d << EOF
module a;
import b : nonexistent;
EOF

cat > b.d << EOF
module b;
EOF

${DMD} -c a.d

echo ===== Regression 2 - Import names no longer conflict with other  
symbols =====
cat > a1.d << EOF
module a1;
import std.stdio;
int std;
EOF

${DMD} -c a1.d

cat > a2.d << EOF
module a2;
import std.stdio : writeln;
int writeln;
EOF

${DMD} -c a2.d

cat > a3.d << EOF
module a3;
import cstdio = std.stdio;
int cstdio;
EOF

${DMD} -c a3.d

echo ===== Regression 3 - Selective imports no longer overload =====
cat > a.d << EOF
module a;
import b : foo;

void foo(int) {}
void bar() { foo(); }
EOF

cat > b.d << EOF
module b;
void foo() {}
EOF

${DMD} -c a.d


More information about the dmd-beta mailing list