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





------- Comment #1 from dsim...@yahoo.com  2009-03-27 11:48 -------
The problem is the following code:

    } else static if (is(const D == const(float))
                      || is(const(D) == const(double))
                      || is(const(D) == const(real))) { 
      // Do stuff.
    } else // Similar stuff for more types.

The problem is that const(immutable(T)) seems to evaluate to immutable(T), not
const(T), as the following program demonstrates:

import std.stdio;

void main() {
    immutable real foo = 1.0L;
    alias const(typeof(foo)) T;
    writeln(T.stringof);  // Prints immutable(real).
}

This can probably be fixed by changing is(const(T) == const someType) tests to
is(immutable(T) == immutable someType).


-- 

Reply via email to