Logical const

Simen kjaeraas simen.kjaras at gmail.com
Mon Nov 29 18:07:32 PST 2010


Simen kjaeraas <simen.kjaras at gmail.com> wrote:

> It works in many cases, but not for function calls

Some more testing brought this bug to my attention:

void bar( ref int n ) {
     n++;
}

void main( string[] args ) {
     const int n = args.length * 0;
     assert( is( typeof( n ) == const(int) ) );
     bar( n ); // Uhm...
     assert( n == 1 ); // WTF?!?
}


I would say this is seriously bad.
http://d.puremagic.com/issues/show_bug.cgi?id=5291


-- 
Simen


More information about the Digitalmars-d mailing list