http://d.puremagic.com/issues/show_bug.cgi?id=3182

           Summary: compile time access of imported symbol
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: ellery-newco...@utulsa.edu


The following code does not print 'z=1!' when compiled, as if a premature
attempted access to z causes the compiler to believe z doesn't exist even after
the import statement. Take out the first static if, and issue goes away. Change
the import to 'import test2: z;' and issue goes away.

Question: Would I be incorrect in assuming the expected output of this compile
should be

no z!
z!
z=1!


test.d
-------
import tango.io.Stdout;
static if(is(typeof(z))){
    pragma(msg,"z!");
}else{
    pragma(msg,"no z!");
}
import test2;
static if(is(typeof(z))){
    pragma(msg,"z!");
}else{
    pragma(msg,"no z!");
}
static if(z == 1) pragma(msg,"z=1!");

void main(){
}
-------
test2.d
-------
module test2;
const int z = 1;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to