www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Check for return bug

Hello all,

Just reporting a small oddball compiler bug with DMD v0.109. This code will
compile without warnings/errors, even though it is incorrect. If you take out
the if (obj) return line, the compiler will correctly catch the error. Otherwise
it incorrectly continues on.

module test4;


bool func() {return true;}

bool func2()
{
Object obj;

if (obj)
return false;

if (func())
{
}
}


Thanks. :)

Chris Newton
Dec 30 2004