Andrej Mitrovic <[email protected]> wrote:
Oh this one is even more spectacular:
void bar( ref int n )
{
n++;
}
void main( string[] args )
{
immutable int n = args.length * 0;
assert( is( typeof( n ) == const(int) ) );
bar( n ); // Uhm...
assert( n == 1 );
}
K:\code>dmd bug.d -release -O -inline
K:\code>bug
object.Error: assert(0) or HLT instruction
I'll update the bugzilla entry.
Don't. It's your first assert, failing as const(int) != immutable(int) -- Simen
