struct S { int y; @disable this(); } // so construction is required
class C
{
S s;
this(S t)
{
if (bar(s = t)) foo(); // bug: Error: one path skips field s
}
this(S t, int i)
{
i || bar(s = t); // bug: should give error
}
this(S t, int i, int j)
{
i && bar(s = t); // bug: should give error
}
this(S t, int i, long j)
{
i ? bar(s = t) : i; // good: Error: one path skips field s
}
this(S t, int i, long j)
{
i ? i : bar(s = t); // good: Error: one path skips field s
}
}
int bar(S s);
int foo();