blob: 08e6f6930c0bf318ae16b2d190e4d6c373c6c09a [file] [log] [blame]
/*
TEST_OUTPUT:
---
A: false
A: false
fail_compilation/fail7862.d(26): Error: template instance `nonExistent!()` template `nonExistent` is not defined
fail_compilation/fail7862.d(25): Error: template instance `fail7862.B!(A)` error instantiating
---
*/
// https://issues.dlang.org/show_bug.cgi?id=7862
template B(T) {
mixin(
{
foreach (name; __traits(derivedMembers, T)) {}
return "struct B {}";
}()
);
}
struct A {
pragma(msg, "A: " ~ (__traits(compiles, B!A) ? "true" : "false"));
pragma(msg, "A: " ~ (__traits(compiles, B!A) ? "true" : "false"));
B!A c;
static if (nonExistent!()) {}
}
auto d = A.init.c;