Compiler bug..?

Simen Haugen simen at norstat.no
Mon Oct 22 03:57:27 PDT 2007


static if( 1 ) {
    int var;
}

static if( 1 ) {
    float var; // Error, var already defined. As expected.
}


But if we do this....

static if(is(int T == int)) {
    writefln("T: ", typeid(T)); // T: int
}

static if(is(float T == float)) {
    writefln("T: ", typeid(T)); // T: int.... Where's my float?
}

Shouldn't this be a compiler error, or at least a warning? 





More information about the Digitalmars-d mailing list