Created attachment 772
Patch against dmd r686
If an if statement has a variable declarator, a condition is implicitly
converted to bool before its value is assigned to the declared variable. The
following code doesn't compile:
--------------------
void main()
{
if (S s = S()) {} // (3)
}
struct S
{
bool opCast(T : bool)() { return true; }
}
--------------------
% dmd -o- -c test.d
test.d(3): Error: cannot implicitly convert expression (S().opCast()) of type
bool to S