[dmd-internals] Odd lookup bug

Andrei Alexandrescu andrei at erdani.com
Sat Nov 12 17:55:58 PST 2011


I tracked down an odd bug in name lookup. With the latest and greatest 
version of everything, do this:

cd /path/to/phobos
dmd -w -m32 -d -c -o- -I../druntime/import -unittest std/file.d

That works handsomely. Now try this:

dmd -w -m32 -d -c -o- -I../druntime/import std/file.d

Compilation fails with:

std/file.d(1945): Error: undefined identifier package c.stdlib

Fix that, and there will be others. Apparently lookup proceeds 
differently with -unittest, because I cannot see any import of 
std.c.stdlib guarded by version(unittest).

Any idea of what's happening?


Andrei


More information about the dmd-internals mailing list