[phobos] phobos commit, revision 2116

Don Clugston dclugston at googlemail.com
Mon Oct 25 04:21:47 PDT 2010


Cool. This is definitely a compiler bug; it's negating the long before
it stores it. Maybe this is a reduced test case:

void foo(T : long)(T x)
{
	ulong q = cast(ulong)((x < 0) ? -x : x);
	assert(q == 0x1234_5678_9ABC_5A5AL);
}

void bar(T : long)(T x)
{
	foo(x);
}

void main()
{
   bar(0x1234_5678_9ABC_5A5AL);
}
If that passes, it may be a problem with opAssign or with passing
ulong as a function parameter between modules.


More information about the phobos mailing list