Thread overview
Weird static assert behavior
Sep 02, 2005
tetsuya
Sep 07, 2005
Thomas Kühne
Sep 10, 2005
Walter Bright
September 02, 2005
The static assert does inconsistent behavior on dmd0.129, winXP.

<code>
class XXX(int L)
{
static assert(L > 0);             // passes on compilation (should fail
static this() { assert(L > 0); }  // fails on execution
}
void main() { alias XXX!(-1) xxx; }
</code>

cheers,


September 07, 2005
tetsuya schrieb:

> The static assert does inconsistent behavior on dmd0.129, winXP.
> 
> <code>
> class XXX(int L)
> {
> static assert(L > 0);             // passes on compilation (should fail
> static this() { assert(L > 0); }  // fails on execution
> }
> void main() { alias XXX!(-1) xxx; }
> </code>

Added to DStress as http://dstress.kuehne.cn/nocompile/a/assert_11_A.d http://dstress.kuehne.cn/nocompile/a/assert_11_B.d http://dstress.kuehne.cn/nocompile/a/assert_11_C.d http://dstress.kuehne.cn/nocompile/a/assert_11_D.d

Thomas

September 10, 2005
That's the old const folding problem. It's fixed.