Looks like I can work around it by doing this:
---
template makeTest(T, bool b) {
static if((b && something) || (!b && somethingElse)) {
alias Test makeTest;
}
else static assert(0, "some error message");
}
struct Test {
private:
this(T)(T info) {
}
}
void main() {
Test test = Test!(int, true)(5); // Error: template instance
Test!(int,true) Test is not a template declaration, it is a struct
}
---
But this solution isn't very satisfying because Test is no longer
directly protected by the static checks I want.
Shouldn't this work too:
struct Test(T, bool b)
if((b && something ) || (!b && somethingElse))
{
this(T info)
{
}
}
It's still a bug imho though.