[Issue 1273] final-const-invariant.html html errors
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 19 05:36:47 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273
------- Comment #7 from kamm at incasoftware.de 2007-06-19 07:36 -------
The final const invariant page gives this example:
invariant(int) y;
y = 3; // ok
auto q = &y; // q's type is invariant(int)*
*q = 4; // error, invariant
But the line marked as an error compiles fine. Additionally:
static if(is(typeof(y) == int)) // this passes
pragma(msg, "y is of type int");
static if(is(invariant(int) == int)) // but this doesn't
pragma(msg, "invariant(int) is same as int");
static if(is(typeof(q) == int*)) // this passes again
pragma(msg, "&y is of type int*");
Something else, but related
static if(is(invariant int == invariant(int))) // passes too, though they're
different
--
More information about the Digitalmars-d-bugs
mailing list