[dmd-internals] Odd lookup bug

Christian Kamm kamm at incasoftware.de
Sat Nov 12 22:47:04 PST 2011


On Sunday 13 November 2011 02:55 Andrei Alexandrescu wrote:
> 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?

It's bug http://d.puremagic.com/issues/show_bug.cgi?id=6307 .

with -unittest:
std.algorithm -> std.random -> std.numeric -> std.c.stdlib

without -unittest, no one imports std.c.stdlib.

Christian


More information about the dmd-internals mailing list