mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
22 lines
442 B
D
22 lines
442 B
D
// https://issues.dlang.org/show_bug.cgi?id=20021
|
|
struct S
|
|
{
|
|
bool opCast(T : bool)() { return true; }
|
|
S prop() {return this;}
|
|
S prop(S newThis) {return this;}
|
|
}
|
|
|
|
struct T
|
|
{
|
|
bool opCast(T : bool)() { return false; }
|
|
}
|
|
|
|
void test20021()
|
|
{
|
|
static if (T.init)
|
|
static assert(false);
|
|
|
|
// ensure properties are resolved
|
|
static if (!(true && T.init || (S.init.prop = S.init).prop))
|
|
static assert(false);
|
|
}
|