This compiles successfully:
enum hasElaborateAssign(T) = is(typeof(foo!T())) || true;
//static assert(hasElaborateAssign!int);
static assert(is(typeof(foo!int())));
void foo(T)()
{
static assert(hasElaborateAssign!T);
}
but when uncommenting the first assertion, the second assert fails with
error test.d(5): Error: static assert (is(typeof(__error))) is false
Comment #1 by dlang-bugzilla — 2015-09-01T05:44:26Z
This is a problem in the implementation of instance cache. None of old versions did support it.
(In reply to Vladimir Panteleev from comment #1)
> This appears to be a regression.
>
> Introduced by https://github.com/D-Programming-Language/dmd/pull/544
No, before that PR, there's no attribute inference for template functions, so foo!T() didn't see the hasElaborateAssign!T instantiation in its body.
Change to major.
Comment #3 by robert.schadek — 2024-12-13T18:43:47Z